| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The scrubber was comparing the checksum of the file that it
calculated (by reading the file) with the on disk signature
(stored via xattr) wrongly. It was using strlen to calculate
the signature, while the actual length of the signature is
given by the brick. Just use the actual length that the brick
provides instead of trying to calculate the signature length via
strlen API.
* In posix, gfid2path was using the same string that contains the
list of all the xattrs of file to save the value of the gfid2path
xattr as well. This causes confusion when gfid2path xattr is queried
by scrubber for getting the actual path of a corrupted file. Use
separate string to fetch the value of the xattr instead of the string
that contains the list of xattrs.
Change-Id: I2d664ab524d2b312233476cb35863dde3122e9a9
fixes: bz#1654805
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Internal fops (with frame->root->pid < 0) are used to heal
or move data and maintains data integrity. That is they do not
modify client data which holds the lease. Hence no need to recall
Lease for such fops.
Note: Like for locks, we would need rebalance and self-heal
daemon process to heal lease state as well.
Change-Id: I8988693fef8d00e17c19dcc842e2238f9eb5ab48
updates: bz#1648768
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems there were quite a few unused enums (that in turn
cause unndeeded memory allocation) in some xlators.
I've removed them, hopefully not causing any damage.
Compile-tested only!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: I8252bd763dc1506e2d922496d896cd2fc0886ea7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warning by clang is due to the fact that we check for
frame->root to be NULL, but in stack unwind, we ignore the
same.
If frame is non-NULL then frame->root is non-NULL as frame
creation ensures this. Further, across the code we do not
check both frame and frame->root for validity.
Hence to fix these clang issues, removing the check for
frame->root in the various functions.
NOTE: Initially clang reported 14 issues in the file, but
post commit 6eabefe6 the number reduced to 4, unsure why as
that commit does not address this issue.
Change-Id: I04b63f2d006a1f95773aae9f904b4bd3d5118e62
Updates: bz#1622665
Signed-off-by: ShyamsundarR <srangana@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes coverity
CID : 1356537
https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389108&defectInstanceId=26791927&mergedDefectId=1356537
CID : 1395666
https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389187&defectInstanceId=26791932&mergedDefectId=1395666
CID : 1351707
https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=1351707
CID : 1396910
https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=13596910
Change-Id: I8094981a741f4d61b083c05a98df23dcf5b022a2
updates: bz#789278
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
rpcsvc_transport_unix_options_build() allocates the dictionary and sets
it in the options variable, there is no need to allocate it before passing
to the function in changelog_rpc_server_init()
updates bz#1650403
Change-Id: I5b4caedba6bda706dee723a2be34c3981bf971fb
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the snapdaemon can reach the lru limit of the inode table
and start sending forgets on the inodes that are least recently used.
snapview-server maintains the mapping between the domain of the
snapdaemon and the gfapi instance which it uses to access the snapshots
via a handle that is stored in the inode context of snapdaemon's inode.
The handle is glfs_h_object structure which itself points to the actual
inode present in the gfapi world.
But, when snapview-server receives forget on a inode, it deleted the
inode context without actually closing the handle it had obtained to
map the inode from snapdaemon to the inode in gfapi world.
So, this change makes sure that, the handle is closed as part of the
inode forget. And this closure of the handle will result in gfapi
world receiving forget and unref on its corresponding inode. But
care must be taken to ensure before the closure to ensure that
the gfapi instance from which the handle came from, is still valid
and not destroyed. Otherwise, sending a forget downward to the gfapi
world might result in the access of freed pointers. Hence, the
snapview-server xlator first checks whether that gfapi instance is
still there or not and then proceeds with closure of the handle.
Change-Id: Ia7bb45112d0c651cc95f2e54d33d925dbd6955b0
fixes: bz#1646728
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In pl_metalk(), logging was being done in a synchronized region.
Moving the log out of the synchronized region to avoid other threads
from being blocked on the lock.
Thanks to Yaniv Kaul for pointing this out.
Change-Id: I0cb39fb23ae7c798ca9c42c390500491aa8e622b
updates: bz#1644758
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the glusterfs server recalls the lease, it expects
client to flush data and unlock the lease. If not it sets
a timer (starting from the time it sends RECALL request) and post
timeout, it revokes it.
Here we could have a race where in client did send UNLK
lease request but because of network delay it may have reached
after server revokes it. To handle such situations, treat
such requests as noop and return sucesss.
Change-Id: I166402d10273f4f115ff04030ecbc14676a01663
updates: bz#1648768
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From testing & code-reading, found couple of places where
we incorrectly unref the inode resulting in use_after_free
crash or ref leaks. This patch addresses couple of them.
a) When we try to grant the very first lease for a inode,
inode_ref is taken in __add_lease. This ref should be active
till all the leases granted to that inode are released (i.e,
till lease_cnt > 0). In addition even after lease_cnt becomes '0',
the inode should be active till all the blocked fops are resumed.
Hence release this ref, after resuming all those fops. To avoid
granting new leases while resuming those fops, defined a new boolean
(blocked_fops_resuming) to flag it in the lease_ctx.
b) 'new_lease_inode' which creates new lease_inode_entry and
takes ref on inode, is used while adding that entry to
client_list and recall_list.
Use its counter function '__destroy_lease_inode' which does unref
while removing those entries from those lists.
c) inode ref is also taken when added to timer->data. Unref the same
after processing timer->data.
Change-Id: Ie77c78ff4a971e0d9a66178597fb34faf39205fb
updates: bz#1648768
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
|
|
|
|
|
| |
CID: 1325524
Change-Id: Ic713285bd9e76d8e4dc1815aa471087d279008b5
updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch fixes 1388996 : Dereference null return value
updates: bz#789278
Change-Id: I9351ae43736efd2f9abe4e1888dba89b6b3e1fe3
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
| |
Addresses CID 1396292
Change-Id: I9141502a12fb3e18c04d07c79da87a5ebb2cfc23
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
| |
Fixes CID 1396581
Change-Id: Ic04091b5783a75d8e1e605a9c1c28b77fea048d3
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on the proposal to remove few features as they are not
actively maintained [1], removing 'glupy' translator from the
build.
[1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html
This patch aims at clearing the translator from build and tests.
A followup is needed to remove the code from repository.
Updates: bz#1642810
Change-Id: I41d0c1956330c3bbca62c540ccf9ab01bbf3a092
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the current scheme of glusterfs where lock migration is
experimental, (ideally) the rebalance process which is migrating
the file should request for a metalock. Hence, the metalock count
should not be more than one for an inode. In future, if there is a
need for meta-lock from other clients, this patch can be reverted.
Since pl_metalk is called as part of setxattr operation, any client
process(non-rebalance) residing outside trusted network can exhaust
memory of the server node by issuing setxattr repetitively on the
metalock key. The current patch makes sure that more than
one metalock cannot be granted on an inode.
Fixes CVE-2018-14660
updates: bz#1644758
Change-Id: Ie1e697766388718804a9551bc58351808fe71069
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, there are possibilities in few places, where a user-controlled
(like filename, program parameter etc) string can be passed as 'fmt' for
printf(), which can lead to segfault, if the user's string contains '%s',
'%d' in it.
While fixing it, makes sense to make the explicit check for such issues
across the codebase, by making the format call properly.
Fixes: CVE-2018-14661
Fixes: bz#1644763
Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
A compromised client can set arbitrary values for the GF_XATTROP_ENTRY_IN_KEY
and GF_XATTROP_ENTRY_OUT_KEY during xattrop fop. These values are
consumed by index as a filename to be created/deleted according to the key.
Thus it is possible to create/delete random files even outside the gluster
volume boundary.
Fix:
Index expects the filename to be a basename, i.e. it must not contain any
pathname components like "/" or "../". Enforce this.
Fixes: CVE-2018-14654
Fixes: bz#1644760
Change-Id: I35f2a39257b5917d17283d0a4f575b92f783f143
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
|
|
|
|
|
| |
Change-Id: Ib8bdf210a896423abcd7413dd4896d424ac0f561
fixes: bz#1626610
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on the proposal to remove few features as they are not
actively maintained [1], removing tier translator from the
build. Also make sure there are no regression tests involving
tiering feature are present.
[1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html
Change-Id: I2c177f711f9b54b7b24e1a13525ff3132bd9a9c5
updates: bz#1642807
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Removed VALIDATE_OR_GOTO check on "this"
Updates: bz#1622665
Change-Id: Ie0d74525901ebf9daa1a5e788a035db6dc5d8c06
Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID:
1394664 : CHECKED_RETURN
1356534 : Macro compares unsigned to 0 (NO_EFFECT)
1356532 : Macro compares unsigned to 0 (NO_EFFECT)
updates: bz#789278
Change-Id: I04d64fd8c007627611710dc56109b76eeb59333a
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Glusterfs leases expects lease_id to be set and sent
for each fop to determine conflict resolution with the
existing lease.
Incase if not set (most likely if there is an older
client in a mixed cluster), it makes sense to consider
it as conflicitng fop and recall the lease.
Also fixed the return status check for __remove_lease(),
wherein non-negative value is considered as success case.
Change-Id: I5bcfba4f7c71a5af7cdedeb03436d0b818e85783
updates: #350
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
|
|
|
|
|
| |
Fixes: 124759 1288787
Change-Id: Ib8999242fc3ea5f4ea80246659899d2d4f06c506
updates: bz#789278
Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID:
1396179: Read from pointer after free
1396178: Use after free
Change-Id: I47a2e4aa257e0c4dbdf2e1fd2e0748902764463f
fixes: bz#789278
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID: 1396177: NULL dereference.
updates: bz#789278
Change-Id: Ic5d302a5e32d375acf8adc412763ab94e6dabc3d
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID 1288790: RESOURCE_LEAK.
updates: bz#789278
Change-Id: I34bb410f1d3027e2d4c21044e87e319360344e04
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While it may slightly reduce accuracy, I think it's better to
acquire the time outside a lock and then memcpy the value while
under lock.
Compile-tested only!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: Ic8fb94a56c4fa2d3b13e59767e13646fb39342ba
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In __shard_update_shards_inode_list(), previously shard translator
was not holding a ref on the base inode whenever a shard was added to
the lru list. But if the base shard is forgotten and destroyed either
by fuse due to memory pressure or due to the file being deleted at some
point by a different client with this client still containing stale
shards in its lru list, the client would crash at the time of locking
lru_base_inode->lock owing to illegal memory access.
So now the base shard is ref'd into the inode ctx of every shard that
is added to lru list until it gets lru'd out.
The patch also handles the case where none of the shards associated
with a file that is about to be deleted are part of the LRU list and
where an unlink at the beginning of the operation destroys the base
inode (because there are no refkeepers) and hence all of the shards
that are about to be deleted will be resolved without the existence
of a base shard in-memory. This, if not handled properly, could lead
to a crash.
Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499
updates: bz#1605056
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
One needs to be very careful about giving same key for the key and
SLEN(key) arguments in dict_xxxn() functions. Writing macros that
would take care of passing the SLEN(key) would help reduce this
burden on the developer and reviewer.
updates: bz#1193929
Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CID:
1395812 Explicit null dereferenced
1356542 Dereference null return value
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407100&mergedDefectId=1395812
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407215&mergedDefectId=1356542
Change-Id: I2c20972a8080fa7a70b88eab0688b9cf734bbf24
updates: bz#789278
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID 1325525 (double free).
updates: bz#789278
Change-Id: I26a5f428dde83dd7708815f06830decf4068b94c
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID 1356544 and 1356539.
Both are of type NULL_RETURNS.
Change-Id: I2ef7c3ff9929c4d85b79fff00e835ebee3ff3ce0
updates: bz#789278
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
When compiling in other architectures there appear many warnings. Some
of them are actual problems that prevent gluster to work correctly on
those architectures.
Change-Id: Icdc7107a2bc2da662903c51910beddb84bdf03c0
fixes: bz#1632717
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
|
|
|
|
|
|
| |
Change-Id: I87f01d86f50eb2fca21febb0ea3e77fbd152eb93
updates: bz#1626610
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
|
|
|
|
|
|
| |
CID: 1394649 1394657
Issue: Explicit null dereferenced
Change-Id: Ic1040ffa5548e1ecd49cfdc9a8716be445cbdf0f
Updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Current resource cleanup sequence is not
perfect while brick mux is enabled
Solution: 1) Destroying xprt after cleanup all fd associated
with a client
2) Before call fini for brick xlators ensure no stub
should be running on a brick
Change-Id: I86195785e428f57d3ef0da3e4061021fafacd435
fixes: bz#1631357
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes CID : 1124725
Issue : Resource leak
updates: bz#789278
Change-Id: I2afe65875fa393fd2d2f90b6f7cf7f6782dabf89
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: local could be NULL
Added condition checks to address this issue
Updates: bz#1622665
Change-Id: I7be7dacc5386a77441385240b43f22d85074b69d
Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Added a Label "err" to avoid NULL pointer dereferencing
Updates: bz#1622665
Change-Id: I7ec02a9cbbc482c2cf77f66e5692e86cd251cd53
Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
CID: 1394631 1394634 1394643 1394645 1394652 1394655 1394661 1394666
1394669 1394670 1394671
Issue: Argument cannot be negative
Change-Id: Id4a9b1adcc271374971e788f161d91e8c9ac442f
Updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Till now, glusterd was generating the volfile path for the snapshot
volume's bricks like this.
/snaps/<snap name>/<brick volfile>
But in reality, the path to the brick volfile for a snapshot volume is
/snaps/<snap name>/<snap volume name>/<brick volfile>
The above workaround was used to distinguish between a mount command used
to mount the snapshot volume, and a brick of the snapshot volume, so that
based on what is actually happening, glusterd can return the proper volfile
(client volfile for the former and the brick volfile for the latter). But,
this was causing problems for snapshot restore when brick multiplexing is
enabled. Because, with brick multiplexing, it tries to find the volfile
and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e.
/snaps/<snap name>/<snap volume name>/<brick volfile>
So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc
request to glusterd for obtaining the brick volume file, glusterd was
returning the client volume file of the snapshot volume instead of the
brick volume file.
Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e
fixes: bz#1635050
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the scripts that have a #!/usr/bin/python3 shebang do not have a
main() like function. These scripts will not get executed but only
imported. They do not need the shebang.
A few others are not installed with 'make install', but do have a main()
like function. These scripts are expected to be used by developers for
different tasks (mostly code generation). Marking these scripts
executable to make it easier to identify them.
Change-Id: I73541471deb7e0830766b804786244e73dfe4221
Updates: #411
Signed-off-by: Niels de Vos <ndevos@redhat.com>
|
|
|
|
|
|
|
|
| |
This patch fixes CID 1356508 and 1356577.
Change-Id: I09bc5398fbf6ee49fc066b42aaedf1170df39df8
updates: bz#789278
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a previous patch (https://review.gluster.org/20769) we've
added the key length to be passed to dict_* funcs, to remove the need
to strlen() it. This patch moves some code to use it.
Please review carefully.
Compile-tested only!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6
|
|
|
|
|
|
|
|
|
| |
Added checks to avoid NULL pointer dereferencing
Updates: bz#1622665
Change-Id: I8e441c2931f406a6012e418127550bdf454a599a
Signed-off-by: Iraj Jamali <ijamali@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the applications are {c|m}time dependant
and very few are atime dependant. So provide noatime
option to not update atime when ctime feature is
enabled.
Also this option has to be enabled with ctime
feature to avoid unnecessary self heal. Since
AFR/EC reads data from single subvolume, atime
is only updated in one subvolume triggering self
heal.
updates: bz#1593538
Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e
Signed-off-by: Kotresh HR <khiremat@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes CIDs: 1388779,1390242,1390057
The patch does the following:
1. Changes the prototype of mq_inspect_file_xattr() and mq_xattr_state()
to have a parameter of struct iatt * instead of struct iatt.
2. Remove unneeded struct iatt parameter from
mq_inspect_directory_xattr()
Change-Id: I1f6eabda042f0fe56d8c9bca010302f5e518dbe4
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Replaced this->name with "ctr"
Updates: bz#1622665
Change-Id: I49af42a5d77c98ffb34224c8800757b8986012ea
Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Added ternary operator to avoid NULL pointer dereferencing
Updates: bz#1622665
Change-Id: I903ec1973fd4bb6473d16e2680bd86ac3a20e093
Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
|