summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* storage/posix: Set errno for xattrop failuresPranith Kumar K2014-12-101-0/+3
| | | | | | | | | | Change-Id: I4d44068c8da5257227d62906ec18ae16f6ed6c02 BUG: 1172477 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9261 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
* nfs: prevent potential NULL dereference in mnt3_readlink_cbk()Niels de Vos2014-12-101-2/+6
| | | | | | | | | | | | | | In case 'mres' is NULL, we jump to 'mnterr' where 'mres->req' will be used. This will cause a segmentation fault, which we really do not want. Change-Id: I01d6f3aa0343def54dcd4a5610001ff7d62c8834 CID: 1256179 BUG: 789278 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9257 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
* features/snapview-client: handle readdir requests differently for sambaRaghavendra Bhat2014-12-097-9/+722
| | | | | | | | | | | * For samba export, the entry point is also added to the readdir response. Change-Id: I825c017e0f16db1f1890bb56e086f36e6558a1c2 BUG: 1168875 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9218 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/afr: Associate the inode returned by inode_link() with corresponding ↵Krutika Dhananjay2014-12-091-1/+4
| | | | | | | | | | | | | entry Change-Id: Ic4436a64075a2615a2293cdfdf2ba6622827cafa BUG: 1129939 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9254 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* api, glusterfsd: Cleanup upon failure in glusterfs_ctx_defaults_init()Vijay Bellur2014-12-092-7/+20
| | | | | | | | | | | | | This got introduced due to 656711d935000c16. Coverity also picked this up as CIDs 1256176, 1256178, 1256180. Signed-off-by: Vijay Bellur <vbellur@redhat.com> Change-Id: If12fa0075634383975846181917a2f9650f790e3 BUG: 789278 Reviewed-on: http://review.gluster.org/9213 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
* glusterd: Coverity fix for string_overflow overrunGauravKumarGarg2014-12-082-3/+3
| | | | | | | | | | | | | | | | | | | | In function glusterd_dump_peer() it is copying "input_key" into "key" buffer without checking the length which might cause string_overflow overrun. Similar problem with other coverity issue. With this fix it will copy "input_key" into "key" buffer by maximum length of buffer. Coverity CID: 1256171 Coverity CID: 1256172 Coverity CID: 1256174 Change-Id: I4e092309d9503bd79ff82cf83ed5e8d758743453 BUG: 1093692 Signed-off-by: Gaurav Kumar Garg ggarg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/9208 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* gfapi: new inode created in glfs_resolve_component even if inode is in inode ↵Rajesh Joseph2014-12-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table problem: USS allows split-brain file to be accessed while main volume gives I/O error. cause: AFR detects split-brain on lookup. It stores this information in inode context. open and readv fop checks this flag from inode context. open and readv fop fails if split-brain flag is set for the file. USS uses gfapi to access snapshot volume. During open call gfapi internally calls glfs_resolve_component. glfs_resolve_component generates a new inode even if inode is present for the file. Because of which afr_lookup acts on a new inode which does not contain the split-brain flag. Bug: 1171615 Change-Id: I1b4fddf4bd3c734a319ecfae804a3439866d157c Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/9253 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* libgfapi: Wait for GF_EVENT_CHILD_DOWN in glfs_fini()Anoop C S2014-12-084-20/+66
| | | | | | | | | | | | | | | | | | | | | | Whenever glfs_fini() is being called, currently no check is made inside the function to determine whether the child is already down or not. This patch will wait for GF_EVENT_CHILD_DOWN for the active subvol and then exits. TBD: Apart from the active subvol, wait for other CHILD_DOWN events generated through operations like volume set in future. Change-Id: I81c64ac07b463bfed48bf306f9e8f46ba0f0a76f BUG: 1153610 Signed-off-by: Anoop C S <achiraya@redhat.com> Reviewed-on: http://review.gluster.org/9060 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* rdma:vectored write fails for rdma.Mohammed Rafi KC2014-12-072-3/+3
| | | | | | | | | | | | | | | | | | | | For rdma write with payload count greater than one will fail due to insuffient memory to hold the buffers in rpc transport layer. It was expecting only one vector in payload, So it can only able to decode the first iovec from payload, and the rest will be discarded. Thnaks to Raghavendra Gowdappa for fixing the same. Change-Id: I82a649a34abe6320d6216c8ce73e69d9b5e99326 BUG: 1171142 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9247 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* build: only install geo-rep scripts when enabledNiels de Vos2014-12-072-1/+7
| | | | | | | | | | | | | | When geo-replication is not enabled, the related scripts should not get installed. EPEL-5 does not support geo-replication, and the installed but unpackaged scripts cause rebuilding for .el5 to fail. BUG: 1169005 Change-Id: I1b6a352b73bd1ed1c5b330f54e26e81aed9a5a4e Reported-by: Lalatendu Mohanty <lmohanty@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9221 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* ec: Fix return errors when not enough bricksXavier Hernandez2014-12-058-14/+81
| | | | | | | | | | | | | | | | | | | | | Changes introduced by this patch: * Fix an incorrect error propagation when the state of the life cycle of a fop returns an error. * Fix incorrect unlocking of failed locks. * Return ENOTCONN if there aren't enough bricks online. * In readdir(p) check that the fd has been successfully open by a previous opendir. Change-Id: Ib44f25a1297849ebcbab839332f3b6359f275ebe BUG: 1162805 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9098 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Fixed small typo in marker.cJan-Hendrik Zab2014-12-051-1/+1
| | | | | | | | | | Change-Id: Iec89e7141f6ff3216355d8a6b971617e16df679b BUG: 1075417 Signed-off-by: Jan-Hendrik Zab <zab@l3s.de> Reviewed-on: http://review.gluster.org/9238 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss/gluster: Send success on parent lookup of entry-pointvmallika2014-12-053-14/+107
| | | | | | | | | | | | | | | | | | When a lookup sent to snapview-server for entry-point directory protocol server first tries to resolve gfid of a parent directory. looking up the parent gfid from a latest snapshot can fail if the volume is a restored volume. As this gfid is already looked-up by snapview-client, we can return success for the parent gfid. Change-Id: Ic9b20561ef79b93032f07c3a81eae54a94e1747b BUG: 1162498 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9229 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/afr: Eliminate locking in sh domain in metadata self-healKrutika Dhananjay2014-12-051-35/+2
| | | | | | | | | | Change-Id: I9ef25a17c9a43ba06fac2ad3f7c18cb47de91537 BUG: 1170913 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9240 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* ec: Temporary fix for quota.tXavier Hernandez2014-12-041-0/+1
| | | | | | | | | | | | | | | This fix solves a problem with tests/basic/ec/quota.t that generates a segmentation fault in DHT. This is a temporary fix until bug #1167793 is solved. Change-Id: I8587e66a63375ba2b312e8c0bfa1dd0d94d4c19f BUG: 1129939 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9222 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Fix mutex related coverity scan issuesXavier Hernandez2014-12-041-2/+14
| | | | | | | | | | | | | | | | | | This patch solves 3 issues detected by coverity scan: CID1241484 Data race condition CID1241486 Data race condition CID1256173 Thread deadlock With this patch, inode lock is never acquired inside a region locked with fop->lock. Change-Id: I35c4633efd1b68b9f72b42661fa7c728b1f52c6a BUG: 1170254 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9230 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* ec: Fix incorrect value of EC_MAX_NODESXavier Hernandez2014-12-042-1/+4
| | | | | | | | | | | | | EC_MAX_NODES was incorrectly calculated. Now the value if computed as the minimum between the theoretical maximum and the limit imposed by the Galois Field. Change-Id: I75a8345147f344f051923d66be2c10d405370c7b BUG: 1167419 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9193 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* ec: Fix self-healing issues.Xavier Hernandez2014-12-0410-313/+548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three problems have been detected: 1. Self healing is executed in background, allowing the fop that detected the problem to continue without blocks nor delays. While this is quite interesting to avoid unnecessary delays, it can cause spurious failures of self-heal because it may try to recover a file inside a directory that a previous self-heal has not recovered yet, causing the file self-heal to fail. 2. When a partial self-heal is being executed on a directory, if a full self-heal is attempted, it won't be executed because another self-heal is already in process, so the directory won't be fully repaired. 3. Information contained in loc's of some fop's is not enough to do a complete self-heal. To solve these problems, I've made some changes: * Improved ec_loc_from_loc() to add all available information to a loc. * Before healing an entry, it's parent is checked and partially healed if necessary to avoid failures. * All heal requests received for the same inode while another self-heal is being processed are queued. When the first heal completes, all pending requests are answered using the results of the first heal (without full execution), unless the first heal was a partial heal. In this case all partial heals are answered, and the first full heal is processed normally. * An special virtual xattr (not physically stored on bricks) named 'trusted.ec.heal' has been created to allow synchronous self-heal of files. Now, the recommended way to heal an entire volume is this: find <mount> -d -exec getfattr -h -n trusted.ec.heal {} \; Some minor changes: * ec_loc_prepare() has been renamed to ec_loc_update(). * All loc management functions return 0 on success and -1 on error. * Do not delay fop unlocks if heal is needed. * Added basic ec xattrs initially on create, mkdir and mknod fops. * Some coding style changes Change-Id: I2a5fd9c57349a153710880d6ac4b1fa0c1475985 BUG: 1161588 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9072 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* protocol/server: No root-squash checks for self-heal pidPranith Kumar K2014-12-042-0/+26
| | | | | | | | | | | | | | | | | | Problem: Self-heal pid used to be -1 which was colliding with gsyncd. Gsyncd was not checked for root-squash authentication. Recently self-heal pid changed to -6, but root-squash authentication is not disabled for this. Fix: disable root-squash authentication for self-heal Change-Id: I93233d4ae681cb936d166b22992eb47c658ea977 BUG: 1170407 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9231 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/index: closedir() if fd_ctx_set() fails in __index_fd_ctx_get.Vijay Bellur2014-12-041-0/+1
| | | | | | | | | | | Change-Id: I9ab599cf4a90c2e285d63ec0f56af210709285b6 BUG: 1166284 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/9168 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Regression test portability: basic/afr/resolve.tEmmanuel Dreyfus2014-12-041-1/+3
| | | | | | | | | | | | | | | | | | | | Final test in basic/afr/resolve.t checks for a failure after breaking the backend. But since the tested file was accessed just before that operations, it may still be in kernel page cache. As a result, file read is handled by kernel cache and never sent to the filesystem, and the test is successful where it should have failed. Fix this by waiting 10s before reading the supposed-to-be-broken file. BUG: 1129939 Change-Id: I97efc00bc8a5f954b1df786cdede468af8bf6485 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9075 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Regression test portability: statEmmanuel Dreyfus2014-12-041-52/+51
| | | | | | | | | | | | | Improve Linux stat emulation for BSD so that it can handle multiple files at once. This is required now tests/basic/afr/data-self-heal.t uses that syntax. BUG: 1129939 Change-Id: I2720d0e8a0d4dedbb8d51fcde3586b4e7d8bb492 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9232 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* heal: free leaked frames.Ravishankar N2014-12-041-0/+2
| | | | | | | | | | | | | | | | | | | 'gluster v heal <VOLNAME> info` waits for about 10 seconds before printing the heal info and exiting. Problem: glfsh_process_entries() is not freeing the frames it created. Thus when glfs_fini() is called, it busy waits for 10 seconds for background frames to finish before returning error. Fix: Destroy the frames in that are created in glfsh_process_entries(). Change-Id: I5484d1b7301a355b913ae9c15b8a62471036c755 BUG: 1169335 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9224 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Glusterfs/posix: Stack corruption in posix_handle_pumpNithya Balachandran2014-12-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | posix_handle_pump can corrupt the stack if the buffer passed to it is too small to hold the final path. Fix : Check if the buffer is sufficiently large to hold the new path component before modifying it. This will prevent the buffer overrun but the path returned will most likely have too many symbolic links causing subsequent file ops to fail with ELOOP. The callers of this function do not currently check the return value. The code needs to be modified to have all callers check the return value and take appropriate action in case of an error. Change-Id: I6d9589195a4b0d971a107514ded6e97381e5982e BUG: 1113960 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/8189 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: change license of arequal-checksum.c to include GPL v2.Ravishankar N2014-12-031-13/+4
| | | | | | | | | | | | In line with the licensing scheme of other files in the project. Change-Id: Ic4c7dfcd2f2ceaeda9ec05bd37de8ef49a1c6206 BUG: 1168207 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9203 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Change licenseXavier Hernandez2014-12-0323-369/+138
| | | | | | | | | | Change-Id: Iae90ade2421898417b53dec0417a610cf306c44b BUG: 1168167 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9201 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: stat(1)Emmanuel Dreyfus2014-12-032-1/+11
| | | | | | | | | | | | | | - Improve Linux stat(1) emulation for BSD: %t and %T should be 0 for non device nodes. - Remove what seems like a typo in entry-self-heal.t, which blocks in Linux stat(1) emulation for BSD. BUG: 1129939 Change-Id: I7635aa105e6d309cdb74608bdaba4135c7c00dd4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9217 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: basic/file-snapshot.tEmmanuel Dreyfus2014-12-031-0/+7
| | | | | | | | | | | | | | | | | | | - For some odd reason, setfattr(1) could fail on big-file just after it was created by touch(1). Add a test in between to wait for the file to be visible by ls(1). - After switching to a snapshot, the file content is still in kernel cache, and the old content may be readen for a few seconds after the snapshot switch. Use ( cd $M0 && umount $M0 ) to flush vnodes and therefore invalidate the cache. - Unmount the mount point at the end of the test for the cleanliness sake. BUG: 1129939 Change-Id: I5a0d14db13e79323147761dfe50c41ae6a1cb844 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9220 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss: CIFS gives error while accessing .snaps directoryRajesh Joseph2014-12-034-24/+70
| | | | | | | | | | | | | | | | | | | | | CIFS sends getxattr call while accessing .snaps directory. snapview server should return ENODATA if getxattr is called on .snaps folder. Also flush on .snaps folder should be handled. Windows client sends and getxattr call on the parent folder of .snaps with a special key to get the real filename of a file. This is used by samba to do case insensitive check of files. Fixed few FreeBSD compilation error. bug: 1168875 Change-Id: I74d5cb4419568c8ed8709ba6d1ddff0e41392204 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/9211 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Data self-heal test casesPranith Kumar K2014-12-022-0/+213
| | | | | | | | | Change-Id: I74d08797b791ea6649d9aba585996e9ec680e3f8 BUG: 1128721 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8538 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com>
* glusterd: use synclock_t for synchronizing concurrent '\op_sm\' invocationsKrishnan Parthasarathi2014-12-011-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | In glusterd_op_sm(), we lock and unlock the gd_op_sm_lock mutex. Unfortunately, locking and unlocking can happen in different threads (task swap will occur in handler call with use of synctasks). This case is explictely covered by POSIX: the behavior is undefined. http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html When unlocking from a thread that is not owner, Linux seems to be fine (though you never know with unspecified operation), while NetBSD returns EPERM, causing a spurious error in tests/basic/pump. To fix this, we use synclock_t which was precisely meant for this. synclock is a pthread_mutex_t like synchronization object which uses the synctask handle for owner and is immune to the task being run on multiple threads during its lifetime. Change-Id: Idca15190d42f32a843088cc8236138f676377586 BUG: 1129939 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9212 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* mgmt/glusterd: Out of bounds access to fs_info structPetr Medonos2014-12-011-1/+1
| | | | | | | | | | | Change-Id: Ifa0d4ac17f9da94660a7b7f567a0f07b5cec7aec BUG: 1164775 Signed-off-by: Petr Medonos <petr.medonos@etnetera.cz> Reviewed-on: http://review.gluster.org/9138 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* USS : fill proper uid and gid during a access call from nfsSachin Pandit2014-12-012-1/+207
| | | | | | | | | | | | | | | | | | | | Problem : when an user tries to access a file/folder for which he does not have a proper permission required then fuse gives out a proper error "Permission denied", but nfs does not give out that error, rather he can access the file/folder. The reason being uid and gid of call frame stack takes a default value of uid and gid which point to root permission. Solution : Set a proper uid and gid during a access call from nfs Change-Id: Ib060706fde66ec7e60f242fab1f3e59122ed2245 BUG: 1167580 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9194 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/uss: Create rebalance volfile.Avra Sengupta2014-11-305-21/+117
| | | | | | | | | | | | | | | | | | | | Create a new rebalance volfile, which will not contain snap-view client translators, irrespective of the status of USS. This volfile, will be created and regenerated everytime the fuse-volfile is generated, and will be consumed by the rebalance process. Change-Id: I514a8e88d06c0b8fb6949c3a3e6dc4dbe55e38af BUG: 1164711 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9190 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd/uss: if snapd is not running, return success from ↵Atin Mukherjee2014-11-302-0/+33
| | | | | | | | | | | | | | | | | | glusterd_handle_snapd_option glusterd_handle_snapd_option was returning failure if snapd is not running because of which gluster commands were failing. Change-Id: I22286f4ecf28b57dfb6fb8ceb52ca8bdc66aec5d BUG: 1168803 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9206 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd: logging improvement in txn_opinfo getter/setter functionAtin Mukherjee2014-11-301-11/+12
| | | | | | | | | | | | | | | | | | There is a code path (__glusterd_handle_stage_op) where glusterd_get_txn_opinfo may fail to get a valid transaction id if there is no volume name provided in the command, however if this function fails to get a txn id in op state machine then its a serious issue and op-sm is impacted. From debugability aspect gf_log () can never give the consumer of this function, so logging these failures with gf_log_calling_fn is must here. Change-Id: I4937a9fb20cc6a747fd30dcd9fd4936398d0602a BUG: 1168809 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9207 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* posix: remove duplicate dirfd calls in posix_opendirAtin Mukherjee2014-11-301-1/+1
| | | | | | | | | BUG: 1168910 Change-Id: I285d352d20374bb3edee2db42d062d4724198425 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9186 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Prevent metadata corruption in the race conditions betweenEdward Shishkin2014-11-301-9/+23
| | | | | | | | | | | | | | | | | | | | FOP->open() and FOP->link(). Problem: crypt_open() modifies @local->format, which is used by crypt_link() to store the updated metadata string on disk. This results in metadata corruption. Fixup: Don't modify @local->format by FOP->open(). Instead modify a local copy, allocated in the low-level meta-data handler open_format_v1(). Change-Id: I046bb39ddefc33afe59c8d3b1a2fa798298f8499 BUG: 1157839 Signed-off-by: Edward Shishkin <edward@redhat.com> Reviewed-on: http://review.gluster.org/8982 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* posix: Fix buffer overrun in _handle_list_xattr()Emmanuel Dreyfus2014-11-281-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | In _handle_list_xattr() we test remaining_size > 0 to check that we do not overrun the buffer, but since that variable was unsigned (size_t), the condition would let us go beyond end of buffer if remaining_size became negative. This could happen if attribute list grew between the first sys_llistxattr() call that gets the size and the second sys_llistxattr() call that get the data. We fix the problem by making remaining_size signed (ssize_t). This also matches sys_llistxattr() return type. While there, we use the size returned by the second sys_llistxattr() call to parse the buffser, as it may also be smaller than the size obtained from first call, if attribute list shrank. This fixes a spurious crash in tests/basic/afr/resolve.t BUG: 1129939 Change-Id: Ifc5884dd0f39a50bf88aa51fefca8e2fa22ea913 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9204 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glupy: build fix if python and glusterfs prefix differEmmanuel Dreyfus2014-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | If python is installed in ${pythonprefix} and glusterfs in ${glusterfsprefix}, we have the following values: ${PYTHON}-config --prefix => ${pythonprefix} $libdir => ${glusterfsprefix}/lib Using LDFLAGS="-L`${PYTHON}-config --prefix`/$libdir" we lookf for python libraries in ${pythonprefix}/${glusterfsprefix}/lib while we should be looking for ${pythonprefix}/lib Replacing $libdir by lib breaks bug 1159248, so let us look in both ${pythonprefix}/lib and ${pythonprefix}/$libdir BUG: 1129939 Change-Id: I2fef1b795235d1543a0e5ac619c6c2d59127fb66 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9137 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* gluster/uss: Handle notify in snapview-clientvmallika2014-11-281-0/+25
| | | | | | | | | | | | | | | As there are two subvolumes in snapview-client, there is a possibility that the regular subvolume is still down and snapd subvolume come up first. So if we don't handle this situation CHILD_UP event will be propagated upwards to fuse when regular subvolume is still down. This can cause data unavailable for the application Change-Id: I9e5166ed22c2cf637c15db0457c2b57ca044078e BUG: 1168643 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9205 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: entry self-heal test casesPranith Kumar K2014-11-271-0/+344
| | | | | | | | | Change-Id: I9390bc9274eb2485af541c4044bac12e48c44064 BUG: 1128721 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8539 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: batch of bugs (volume 2)Emmanuel Dreyfus2014-11-2615-18/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various regression test portability in tests/bugs. bug-861542.t - Avoid syntax specific to GNU sed. bug-860663.t - Command argument length is system dependent, and specifying 1000 file path may overflow it. Use a C program to do the job in a portable and efficient way. - Add a test that we created the specified amount of files. bug-858242.c, bug-808400-fcntl.c, bug-808400-flock.c - fstat64() is Linux-specific. Define it as fstat for other systems. bug-823081.t - Use portable tail -n instead of tail --lines In many tests: - Do not assume python interpreter name. Use $PYTHON as defined in env.rc by configure. utils/libcxattr.py - If python version is 2.6 or higher, use a portable mechanism to recover errno. The original version is retained for python version 2.5 and earlier but it only works on Linux. BUG: 1129939 Change-Id: If2fea1ffec5cc6ab2de426fb200e884450afe61b Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9097 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* core: fix remaining *printf formation warnings on 32-bitKaleb S. KEITHLEY2014-11-266-19/+22
| | | | | | | | | | | | | | | | | | This fixes a few lingering size_t problems. Of particular note are some uses of off_t for size params in function calls. There is no correct, _portable_ way to correctly print an off_t. The best you can do is use a scratch int64_t/PRId64 or uint64_t/PRIu64. Change-Id: I86f3cf4678c7dbe5cad156ae8d540a66545f000d BUG: 1110916 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8105 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* doc: Avoid duplicate rdma notes.Humble Chirammal2014-11-262-9/+9
| | | | | | | | Change-Id: I5ede0ffad3870d8d86cb5d551ce188c649b04b44 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8826 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras: geo-rep: Customize the generate gfid script to dirs listAravinda VK2014-11-261-5/+22
| | | | | | | | | | | generate-gfid-file.sh now accepts dirs list file and generate gfids only for those dirs list. Change-Id: Ia78a0a744dc8a079db56c38578cc6fcac2a6fa90 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/8540 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* dict: Remove the redundant hash calculation when the hash size is 1Poornima Gurusiddaiah2014-11-261-5/+23
| | | | | | | | | | | | | Currently the dict is created with hash size 1, i.e. there is only one hash bucket and the calculation of hash decomes redundant. Change-Id: Id70aea0d798902494ebb6d82955d97d591bc73d2 BUG: 789278 Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/8211 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle ESTALE in snapview client when NFS server restartedvmallika2014-11-255-19/+85
| | | | | | | | | | | | | | | When NFS server is restarted inode-context is lost. Nameless lookup will be sent to regular volume. If the gfid is from virtual graph, lookup will fail with ESTALE. We need to send a lookup to snapview server Change-Id: I22920614f0d14cb90b53653fce95b6b70023eba6 BUG: 1166197 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9153 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* dict: Write dict_foreach_* in form of dict_foreach_matchPranith Kumar K2014-11-251-53/+18
| | | | | | | | | | Change-Id: Iaa3454f7f3b6516660b1976bea63e39ea7795f8f BUG: 1164051 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9121 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* core: fix Ubuntu code audit (cppcheck) resultsKaleb S. KEITHLEY2014-11-2512-51/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See also http://review.gluster.org/#/c/7693/, BZ 1091677 AFAICT these are false positives: [geo-replication/src/gsyncd.c:100]: (error) Memory leak: str [geo-replication/src/gsyncd.c:403]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1201]: (error) Possible null pointer dereference: fde [xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr Test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [tests/basic/fops-sanity.c:55]: (error) Buffer overrun possible for long command line arguments. the remainder are fixed with this change-set: [cli/src/cli-rpc-ops.c:8883]: (error) Possible null pointer dereference: local [cli/src/cli-rpc-ops.c:8886]: (error) Possible null pointer dereference: local [contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 2) requires 'long *' but the argument type is 'unsigned long *'. [contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 3) requires 'long *' but the argument type is 'unsigned long *'. [xlators/cluster/dht/src/dht-rebalance.c:1734]: (error) Possible null pointer dereference: ctx [xlators/cluster/stripe/src/stripe.c:4940]: (error) Possible null pointer dereference: local [xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1718]: (error) Possible null pointer dereference: command [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:942]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:1026]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-sm.c:249]: (error) Possible null pointer dereference: new_ev_ctx [xlators/mgmt/glusterd/src/glusterd-snapshot.c:6917]: (error) Possible null pointer dereference: volinfo [xlators/mgmt/glusterd/src/glusterd-utils.c:4517]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:6662]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:7708]: (error) Possible null pointer dereference: this [xlators/mount/fuse/src/fuse-bridge.c:4687]: (error) Uninitialized variable: finh [xlators/mount/fuse/src/fuse-bridge.c:3080]: (error) Possible null pointer dereference: state [xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it). [xlators/performance/quick-read/src/quick-read.c:586]: (error) Possible null pointer dereference: iobuf Rerunning cppcheck after fixing the above: As before, test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [tests/basic/fops-sanity.c:55]: (error) Buffer overrun possible for long command line arguments. As before, false positive: [geo-replication/src/gsyncd.c:100]: (error) Memory leak: str [geo-replication/src/gsyncd.c:403]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1201]: (error) Possible null pointer dereference: fde [xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr False positive after fix: [xlators/performance/quick-read/src/quick-read.c:584]: (error) Possible null pointer dereference: iobuf Change-Id: I20e0e3ac1d600b2f2120b8d8536cd6d9e17023e8 BUG: 1109180 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8064 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>