summaryrefslogtreecommitdiffstats
path: root/xlators/mount
Commit message (Collapse)AuthorAgeFilesLines
* glusterfs SEGV on Fedora 17 from UFO fallocate(2) callv3.3.1qa3Kaleb S. KEITHLEY2012-09-171-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An upload of a file will cause the volume's glusterfs to SEGV when it fields a FUSE_FALLOCATE op. Swift inspects libc to determine if there is a symbol for fallocate(2) and if so will use it. And while the libc in RHEL 6 does have fallocate(2), the version of fuse in RHEL 6 does not support fallocate, and things are handled gracefully elsewhere (the kernel perhaps?) N.B. fallocate was added to version 7.19 of fuse. Fedora 17 and later (and maybe earlier too) has 7.19. RHEL 6 still has 7.13. Glusterfs uses the 7.13 version <linux/fuse.h> (in contrib/fuse-include/fuse_kernel.h) Thus on Fedora 17, with both fallocate(2) in libc and fallocate support in fuse, the fallocate invocation is dispatched to glusterfs, but the dispatch table (fuse_std_ops in xlators/mount/fuse/src/fuse-bridge.c) is too short for one thing; the fallocate opcode (43) indexes beyond the end of the table, and even when that doesn't directly cause a SEGV, the NULL pointer at that location does cause a SEGV when attempting to call the function through the pointer. BUG: 856704 Change-Id: Iffe3994dde6ca29444d07d27eb04d6f86773fa03 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/3941 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mount.glusterfs: Add support for {attribute,entry}-timeout optionsKaushal M2012-09-171-0/+11
| | | | | | | | | | | Change-Id: Ib0c9b5be6f05cf9a36271df67e5e5c251c4c4628 BUG: 829279 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/3840 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Jeff Darcy <obdurodon@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mount.glusterfs NerBSD portability fixEmmanuel Dreyfus2012-09-121-1/+9
| | | | | | | | | | | | | | | | NetBSD stat(1) gets inode using -f %i while Linux uses -c %i This has already been fixed a few lines above, but one test failed to be fixed. This is not based on master, as the code hasbeen reworked a lot, and is already bug-free. BUG: 764655 Change-Id: I5dc1196ddba06ff31f695b7dbb0c6d28df32f324 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/3926 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* NetBSD build fixesEmmanuel Dreyfus2012-07-131-4/+14
| | | | | | | | | | | This is a backport of Change-Id: Icd7290f1e340675d763665a0d0c5f95bc14e0c55 BUG: 764655 Change-Id: Iaca3dc30e61c0864af673b90d2a7fdea6a3143cc Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3577 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Set LD_LIBRARY_PATH before starting glusterfsEmmanuel Dreyfus2012-07-091-0/+2
| | | | | | | | | | | This is a backport of Change-Id: I13bf0bea043351498b4bc885c5ac45b108229a0a BUG: 764655 Change-Id: I7908352f7a9baae48a7c3bd2c8845980d0dc9b96 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3578 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* stat(1) flag to specify format is not portableEmmanuel Dreyfus2012-07-091-1/+9
| | | | | | | | | | | This is a backport of Change-Id: Iae3c40b03118078530c29d14d5f7180c36361c16 BUG: 764655 Change-Id: Ic4e7adbda6b53b248aa93cd20a045cb885fa818e Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3579 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mount.glusterfs: update the glusterd WORKDIRAmar Tumballi2012-07-031-1/+1
| | | | | | | | | Change-Id: I70d091611d314598412b5315adcbe1b5147a8773 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 824231 Reviewed-on: http://review.gluster.com/3512 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* fuse: make SELinux support configurableAnand Avati2012-05-293-16/+27
| | | | | | | | | | | | | Make support for SELinux labels (extended attributes) configurable and disabled by default as it can cause significant performance penalty when enabled (it need not be enabled unless specially crafted policies are set -- which is not by default) Change-Id: I97bc4b1c26cf055fd520e9bf2d49e52b14fe7515 BUG: 811217 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3485 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* fuse, glusterfsd: mount logic fixesCsaba Henk2012-05-272-62/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7d0397c2 introduced two issues: i) broke the libfuse derived mount logic (details below) ii) in case of a daemonized glusterfs client is ran as daemon, parent process can return earlier than the mount is in place, which breaks agents that programmatically do a gluster mount via a direct call to glusterfs (ie. not via mount(8)). This patch fixes these issues by a refactor that merges the approaches sported by commits 7d0397c2 fuse: allow requests during mount (needed for SELinux labels) c5d781e0 upon daemonizing, wait on mtab update to terminate in parent Original daemonized libfuse event flow is as follows: try: fd = open("/dev/fuse") mount("-oopts,fd=%s" % fd ...) mount(8) -f # manipulate mtab except: sp = socketpair() env _FUSE_COMMFD=sp fusermount -oopts fd = receive_fd(sp) where fusermount(1) does: fd = open("/dev/fuse") mount("-oopts,fd=%d" % fd ...) sp = atoi(getenv("_FUSE_COMMFD")) send_fd(sp, fd) daemonize( # in child fuse_loop(fd) ) # in parent exit() As of 013850c9 (instead of adopting FUSE's 47e61004¹), we went for async mtab manipulation, and as of c5d781e0, still wanted keep that in sync with termination of daemon parent, so we changed it to: try: fd = open("/dev/fuse") mount("-oopts,fd=%s" % fd ...) pid = fork( # in child mount(8) -f ) except: sp = socketpair() env _FUSE_COMMFD=sp fusermount -oopts fd = receive_fd(sp) daemonize( fuse_loop(fd) ) waitpid(pid) exit() (Note the new approch came only to direct [privileged] mount, so fusermount based mounting was already partially broken.) As of 7d0397c2, with the purpose of facilitating async mount, the event flow was practically reduced to: fd = open("/dev/fuse") fork( mount("-oopts,fd=%s" % fd ...) fork( mount(8) -n ) ) daemonize( fuse_loop(fd) ) exit() Thus fusermount based mounting become defunct; however, the dead code was still kept around. So, we should either drop it or fix it. Also, the mtab manipulator is forked into yet another child with no purpose, while syncing with it in daemon parent is broken. mount(2) is neither synced with parent. Now we are coming to the following scheme: fd = open("/dev/fuse") pid = fork( try: mount("-oopts,fd=%s" % fd ...) mount(8) -n except: env _FUSE_DEVFD=fd fusermount -oopts ) where fusermount(1) does: fd = getenv("_FUSE_DEVFD") mount("-oopts,fd=%s" % fd ...) daemonize( fuse_loop(fd) ) waitpid(pid) exit() Nb.: - We can't help losing compatibility with upstream fusermount, as it sends back the fd only when mount(2) is completed, thus defeating the async mount approach. The 'getenv("_FUSE_DEVFD")' mechanism is specfic to glusterfs' fusermount (at the moment -- sure we can talk about it with upstream) - fusermount opens /dev/fuse at same privilege level as of original process², so we can bravely go on with doing the open unconditionally in original process - Original mounting code actually tries to mount through fusermount _twice_: if first attempt fails, then, assuming subtype support is missing in kernel, it tries again subtype stripped. However, this is redundant, as fusermount internally also performs the subtype check³. Therefore we simplified the logic to have just a single fusermount call. - we revert the changes to mount.glusterfs as of 7d0397c2, as now there is no issue with glusterfs to work around in that scope ¹ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blobdiff;f=ChangeLog;h=47e61004;hb=4c3d9b19;hpb=e61b775a ² http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l1023 ³ http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;a=blob;f=util/fusermount.c;h=b2e87d95#l839 Change-Id: I0c4ab70e0c5ad7b27337228749b266bcd0ba941d BUG: 811217 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3428 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* fuse: allow requests during mount (needed for SELinux labels)Csaba Henk2012-05-273-29/+136
| | | | | | | | | | | | | | | | | | | | | | | Resurrecting Jeff's commit: commit 7d0397c2144810c8a396e00187a6617873c94002 Author: Jeff Darcy <jdarcy@redhat.com> fuse: allow requests during mount (needed for SELinux labels) that was reverted as of: commit 4ab1c326f3862714b960302f06c6323d6291b695 Author: Vijay Bellur <vijay@gluster.com> Revert "fuse: allow requests during mount (needed for SELinux labels)" BUG: 811217 Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3452 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* mount/fuse: Use state->lk_lock to print lock information on EAGAIN.Mohammed Junaid2012-05-251-4/+3
| | | | | | | | | Change-Id: I24a4a0b1c8dc0b8e08b380a5bc8efc111ccdb2c3 BUG: 808400 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.com/3438 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Revert "fuse-resolve: consider cases where an entry should be resolved even"v3.3.0beta4Vijay Bellur2012-05-171-6/+0
| | | | This reverts commit 27fb213be6101bca859502ac87dddc4cd0a6f272.
* Revert "fuse: allow requests during mount (needed for SELinux labels)"Vijay Bellur2012-05-103-136/+29
| | | | This reverts commit 7d0397c2144810c8a396e00187a6617873c94002.
* glusterfsd: Make sure mountpoint is an absolute pathKaushal M2012-05-081-1/+1
| | | | | | | | | | | | | | | If the mountpoint path given to glusterfs is not an absolute path, convert it to an absolute path by concatenating it with the curren working directory. This prevents cases, where in gluster cannot perform clean unmounts when mount is done with a relative path. Change-Id: Ie25add4e1dc59171e522c4244c79a6c148844ab3 BUG: 819466 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3302 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-resolve: consider cases where an entry should be resolved evenRaghavendra G2012-05-081-0/+6
| | | | | | | | | | | | | | | when parent belongs to active itable. When parent is root, the parent inode returned will always be active_subvol->itable->root and hence there can be cases where we should explicitly resolve the entry in active graph. Change-Id: I4e82df9a351ff6b5304891abc9932495bf7ea79d BUG: 804592 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3007 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Resolve: Assign correct path while resolvingPranith Kumar K2012-05-081-3/+2
| | | | | | | | | Change-Id: Ia17ff38a60225dd2e9115aaa298bed42f9e43f56 BUG: 812277 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3248 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mount.glusterfs: Fix log-levelKaushal M2012-05-041-1/+1
| | | | | | | | | Change-Id: Ia5ad073ba384e1569970ada8763a8bf9bccbc9c4 BUG: 818835 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3272 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* mount/fuse: unref the fds after they have been migrated to the new graphRaghavendra Bhat2012-04-241-19/+35
| | | | | | | | | | | | | | | In fuse upon graph changes fds were being migrated to the new graph. It was done by taking all the fds from the fdtable in a structure and then migrating each fd in the structure to the new graph. But after the fds are migrated the structure which had the fds within it (that is refed fds) was being freed without unrefing the fds, thus leading to a fd leak. Change-Id: I7b25220a48954384a004373d378cee11c6109f7e BUG: 811552 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/3222 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* NetBSD build fixesEmmanuel Dreyfus2012-04-232-1/+5
| | | | | | | | | | | Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Change-Id: I8f9aabeadd2f842521a82e59594115bd80155d68 BUG: 2923 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3053 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: coverity issues fixedAmar Tumballi2012-04-232-2/+8
| | | | | | | | | | | | this is not a complete set of issues getting fixed. Will address other issues in another patch. Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 789278 Reviewed-on: http://review.gluster.com/3145 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* clean up handling of special client pidsCsaba Henk2012-04-232-26/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | - no need to name a lower boundary [drop GF_CLIENT_PID_MIN] - drop utility function to decide about pid speciality [gf_pid_client_check()]; when we implement uniform policy for special pids, use just comparison with GF_CLIENT_PID_MAX (currently such uniform policy exists in io-threads, where special clients get lowest priority) - io-threads: drop numeric literal, use GF_CLIENT_PID_MAX - xattr flipping (in fuse): - fuse_xattr_alloc_default() made static - avoid compiler warnings wrt. partial enum traversal in the switch by not casting the original numeric value to gf_client_pid_t (enum) type - trim down the switch to those cases with which there is something to do [GF_CLIENT_PID_GSYNCD, GF_CLIENT_PID_HADOOP] - eliminate the (theoretical) chance of succesfully returning from fuse_flip_xattr_ns() with unallocated nkey [as was the case with pids GF_CLIENT_PID_{MIN,MAX,DEFRAG}] Change-Id: Ic2b83b908d8e3be23a7fba1e5895869828a6194b BUG: 765433 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3170 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse: allow requests during mount (needed for SELinux labels)Jeff Darcy2012-04-233-29/+136
| | | | | | | | | Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729 BUG: 811217 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3199 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd/rebalance: Start process with xlator option client-pid -3shishir gowda2012-04-161-0/+4
| | | | | | | | | | | | | This would prevent updation of xtime by the marker. Signed-off-by: shishir gowda <shishirng@gluster.com> Change-Id: I11e287511026326271c2926e55993e48b32018f6 BUG: 812287 Reviewed-on: http://review.gluster.com/3144 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Csaba Henk <csaba@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* mount.glusterfs: multiple fixesJeff Darcy2012-04-131-71/+49
| | | | | | | | | | | | | | | | | | | | | * noticed that the regex to parse the options were not fool proof. for example, 'ro' in a logfilename could have made the mount point read-only. Now fixed. * this issue existed for 'acl', 'worm' options. * log-server/log-server-port options were legacy, and no more needed in codebase. * refactored option processing in general to avoid above issues Change-Id: I172d24c86ece9a34420ba997fa385e304b4924ae BUG: 806978 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3058 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* fuse-bridge: generate GFID as gfid-req in fresh lookupAnand Avati2012-04-111-0/+3
| | | | | | | | | | | | | This is necessary for self-heal to assign fresh GFID when performing lookup on files/dirs without GFID (migration from old version, etc.) Change-Id: I6f070255dc6e85bf6625b704cb5fb7f831ee58e6 BUG: 795355 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3101 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
* fuse-bridge/fd-migration: document migration failures in fdctx.Raghavendra G2012-04-043-19/+72
| | | | | | | | | Change-Id: Ib85871e586f89f88dd7bf738fbb284b5d7b70a86 BUG: 809919 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3085 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: adding extra data for fopsAmar Tumballi2012-03-224-94/+115
| | | | | | | | | | | | | with this change, the xlator APIs will have a dictionary as extra argument, which is passed between all the layers. This can be utilized for overloading in some of the operations. Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 782265 Reviewed-on: http://review.gluster.com/2960 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mount/fuse-bridge: don't pass flags O_CREAT | O_EXCL during open as part ofRaghavendra G2012-03-181-1/+3
| | | | | | | | | | | | fd-migration during graph-switch Change-Id: Ia1494941d3e3d5bebdba3483b0ea7b32c9704b8c BUG: 802710 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/2943 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-bridge/graph-cleanup: don't provide a cbk for cleanup syncop taskRaghavendra G2012-03-142-37/+2
| | | | | | | | | | | | | without a cbk, syntask_new returns only after the task is complete. Hence we don't have to wait on a conditional variable in the caller. Change-Id: Ie83894aa6fc02cc3a973930e67ae2b35de3b7647 BUG: 767862 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/2870 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* cleanup and fix xattr namespace flipCsaba Henk2012-03-072-13/+18
| | | | | | | | | | | | | | | | - function of actual flipping made static - clean out references to particular namespaces from flipping logic - namespaces involved in flipping defined at single location - fix fnmatch(3) invocation with reversed pattern and string arguments - instead of "user", use "system" to flip from, because latter is free from supervision of the VFS layer (cf. attr(5)) Change-Id: I3cc5836fadcad5b237fd5c67d0dcaea63aee9164 BUG: 798716 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/2890 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* fops/removexattr: prevent users from removing glusterfs xattrsRajesh Amaravathi2012-03-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | * Each xlator prevents the user from removing xlator-specific xattrs like trusted.gfid by handling it in respective removexattr functions. * For xlators which did not define remove and fremovexattr, the functions have been implemented with appropriate checks. xlator | fops-added _______________|__________________________ | 1. stripe | removexattr and fremovexattr 2. quota | removexattr and fremovexattr Change-Id: I98e22109717978134378bc75b2eca83fefb2abba BUG: 783525 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2836 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* mount.glusterfs: multiple fixesAmar Tumballi2012-02-221-2/+3
| | | | | | | | | | | | | | * fix return value in case of proper 'backup-volfile-server' option, and actual default server based mount failed. * fix a syntax error (bug: 796050) Change-Id: I6a530c9b9431e46f45ec9eeb99f6103386dd10dc Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 796101 Reviewed-on: http://review.gluster.com/2798 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* rpc/clnt: handle PARENT_DOWN event appropriatelyAmar Tumballi2012-02-211-3/+2
| | | | | | | | | | Change-Id: I4644e944bad4d240d16de47786b9fa277333dba4 BUG: 767862 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/2735 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* fuse-bridge: Handle graph-switch.Raghavendra G2012-02-215-75/+522
| | | | | | | | | | | | | | | | | The purpose of this patch is to let protocol/client know when its transports can be disconnected, without application running on gluster mount noticing any effects of graph switch. In order to do this, we migrate all fds and blocked locks to new graph. Once this migration is complete and there are no in-transit frames as viewed by fuse-bridge, we send a PARENT_DOWN event to its children. protocol/client on receiving this event, can disconnect up its transports. Change-Id: Idcea4bc43e23fb077ac16538b61335ebad84ba16 BUG: 767862 Reviewed-on: http://review.gluster.com/2734 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* protocol/client,server: fcntl lock self healing.Mohammed Junaid2012-02-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently(with out this patch), on a disconnect the server cleans up the transport which inturn closes the fd's and releases the locks acquired on those fd's by that client. On a reconnect, client just reopens the fd's but doesn't reacquire the locks. The application that had previously acquired the locks still is under the assumption that it is the owner of those locks which might have been granted to other clients(if they request) by the server leading to data corruption. This patch allows the client to reacquire the fcntl locks (held on the fd's) during client-server handshake. * The server identifies the client via process-uuid-xl (which is a combination of uuid and client-protocol name, it is assumed to be unique) and lk-version number. * The client maintains a list of process-uuid-xl, lk-version pair for each accepted connection. On a connect, the server traverses the list for a matching pair, if a matching pair is not found the the server returns lk-version with value 0, else it returns the lk-version it has in store. * On a disconnect, the server and client enter grace period, and on the completion of the grace period, the client bumps up its lk-version number (which means, it will reacquire the locks the next time) and the server will distroy the connection. If reconnection happens within the grace period, the server will find the matching (process-uuid-xl, lk-version) pair in its list which guarantees that the fd's and there corresponding locks are still valid for this client. Configurable options: To set grace-timeout, the following options are option server.grace-timeout value option client.grace-timeout value To enable or disable the lk-heal, option lk-heal [on|off] gluster volume set command can be used to configurable options Change-Id: Id677ef1087b300d649f278b8b2aa0d94eae85ed2 BUG: 795386 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.com/2766 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* iobuf: use 'iobuf_get2()' to get variable sized buffersAmar Tumballi2012-02-201-0/+5
| | | | | | | | | | | added 'TODO' in places where it is missing. Change-Id: Ia802c94e3bb76930f7c88c990f078525be5459f5 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 765264 Reviewed-on: http://review.gluster.com/388 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* mount/fuse: unref the fd from resolve to avoid fd leakRaghavendra Bhat2012-02-171-0/+3
| | | | | | | | | Change-Id: I162e07219b98669bc6e09784830ca9407518fd8b BUG: 794618 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2760 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* core: add an extra flag to readv()/writev() APIAmar Tumballi2012-02-142-2/+12
| | | | | | | | | | | | needed to implement a proper handling of open flag alterations using fcntl() on fd. Change-Id: Ic280d5db6f1dc0418d5c439abb8db1d3ac21ced0 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 782265 Reviewed-on: http://review.gluster.com/2723 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse: fix resolver to handle graph switches properlyAnand Avati2012-02-084-767/+544
| | | | | | | | | | | | | | perform resolution on the latest graph by caching it in state->itable and use fuse_nodeid as just a hint to the possible final resolved inode (in case it was resolved off the latest graph). GFID is the primary key for resolving inodes on the latest graph. Change-Id: I3921c6f59c9ff80e4ff076bec3bd334423fc36cc BUG: 785675 Reviewed-on: http://review.gluster.com/2703 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* mount/fuse: check for existence of volfilesRajesh Amaravathi2012-02-071-2/+9
| | | | | | | | | | | | | | If glusterd is not running in the client host and/or if there are no volume created yet, this patch ensures that appropriate error message is displayed Change-Id: I15d23a45d70aa27bbdd42f435fe705b14c779e3f BUG: 786077 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2708 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* protocol/client : prevent client from reconnecting when serverKaushal M2012-02-032-0/+15
| | | | | | | | | | | | | | | | | | authentication fails This prevents the client from trying to reconnect on server authentication failure. Reconnecting on authentcation failure causes hung mounts on unauthorised clients. This patch fixes this problem. Also, mount.glusterfs script unmounts mount-point on mount failure to prevent hung mounts. Change-Id: I5615074d27948077bad491a38cecae1b7f5159fb BUG: 765240 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/398 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* complete the implementation of missing 'f**xattr()' fopsAmar Tumballi2012-01-251-45/+129
| | | | | | | | | | | | | | in debug/* and cluster/* translators and a syncop_fsetxattr() added a test case for testing the working of 'f-fop()' on fuse mount. Change-Id: I0c2aeeb30a0fb382ef2495cca1e66b00abaffd35 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 766571 Reviewed-on: http://review.gluster.com/802 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* core: add 'fremovexattr()' fopAmar Tumballi2012-01-252-11/+33
| | | | | | | | | | | so operations can be done on fd for extended attribute removal Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 766571 Reviewed-on: http://review.gluster.com/778 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* core: get xattrs also as part of readdirpAmar Tumballi2012-01-251-0/+3
| | | | | | | | | | | | | readdirp_req() call sends a dict_t * as an argument, which contains all the xattr keys for which the entries got in readdirp_rsp() are having xattr value filled dictionary. Change-Id: I8b7e1290740ea3e884e67d19156ce849227167c0 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 765785 Reviewed-on: http://review.gluster.com/771 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* core: change lk-owner as a 1k bufferAmar Tumballi2012-01-242-6/+6
| | | | | | | | | | | | | so, NLM can send the lk-owner field directly to the locks translators, while doing the same effort, also enabled sending maximum of 500 aux gid over protocol. Change-Id: I87c2514392748416f7ffe21d5154faad2e413969 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 767229 Reviewed-on: http://review.gluster.com/779 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* core: GFID filehandle based backend and anonymous FDsAnand Avati2012-01-204-296/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. What -------- This change introduces an infrastructure change in the filesystem which lets filesystem operation address objects (inodes) just by its GFID. Thus far GFID has been a unique identifier of a user-visible inode. But in terms of addressability the only mechanism thus far has been the backend filesystem path, which could be derived from the GFID only if it was cached in the inode table along with the entire set of dentry ancestry leading up to the root. This change essentially decouples addressability from the namespace. It is no more necessary to be aware of the parent directory to address a file or directory. 2. Why ------- The biggest use case for such a feature is NFS for generating persistent filehandles. So far the technique for generating filehandles in NFS has been to encode path components so that the appropriate inode_t can be repopulated into the inode table by means of a recursive lookup of each component top-down. Another use case is the ability to perform more intelligent self-healing and rebalancing of inodes with hardlinks and also to detect renames. A derived feature from GFID filehandles is anonymous FDs. An anonymous FD is an internal USABLE "fd_t" which does not map to a user opened file descriptor or to an internal ->open()'d fd. The ability to address a file by the GFID eliminates the need to have a persistent ->open()'d fd for the purpose of avoiding the namespace. This improves NFS read/write performance significantly eliminating open/close calls and also fixes some of today's limitations (like keeping an FD open longer than necessary resulting in disk space leakage) 3. How ------- At each storage/posix translator level, every file is hardlinked inside a hidden .glusterfs directory (under the top level export) with the name as the ascii-encoded standard UUID format string. For reasons of performance and scalability there is a two-tier classification of those hardlinks under directories with the initial parts of the UUID string as the directory names. For directories (which cannot be hardlinked), the approach is to use a symlink which dereferences the parent GFID path along with basename of the directory. The parent GFID dereference will in turn be a dereference of the grandparent with the parent's basename, and so on recursively up to the root export. 4. Development --------------- 4a. To leverage the ability to address an inode by its GFID, the technique is to perform a "nameless lookup". This means, to populate a loc_t structure as: loc_t { pargfid: NULL parent: NULL name: NULL path: NULL gfid: GFID to be looked up [out parameter] inode: inode_new () result [in parameter] } and performing such lookup will return in its callback an inode_t populated with the right contexts and a struct iatt which can be used to perform an inode_link () on the inode (without a parent and basename). The inode will now be hashed and linked in the inode table and findable via inode_find(). A fundamental change moving forward is that the primary fields in a loc_t structure are now going to be (pargfid, name) and (gfid) depending on the kind of FOP. So far path had been the primary field for operations. The remaining fields only serve as hints/helpers. 4b. If read/write is to be performed on an inode_t, the approach so far has been to: fd_create(), STACK_WIND(open, fd), fd_bind (in callback) and then perform STACK_WIND(read, fd) etc. With anonymous fds now you can do fd_anonymous (inode), STACK_WIND (read, fd). This results in great boost in performance in the inbuilt NFS server. 5. Misc ------- The inode_ctx_put[2] has been renamed to inode_ctx_set[2] to be consistent with the rest of the codebase. Change-Id: Ie4629edf6bd32a595f4d7f01e90c0a01f16fb12f BUG: 781318 Reviewed-on: http://review.gluster.com/669 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* core/setxattr: prevent users from setting glusterfs xattrsRajesh Amaravathi2012-01-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | * Each xlator prevents the user from setting glusterfs-internal xattrs like trusted.gfid by handling it in respective setxattr functions. The speacial case of trusted.gfid is handled in fuse (Not in posix because posix_setxattr is used to set gfid). * For xlators which did not define setxattr and/or fsetxattr, the functions have been implemented with appropriate checks. xlator | fops-added _______________|__________________________ | 1. afr | fsetxattr 2. stripe | setxatrr and fsetxattr 3. quota | setxattr and fsetxattr Change-Id: Ib62abb7067415b23a708002f884d30e8866fbf48 BUG: 765487 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/685 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* don't try to get ngroups from /proc on non-Linux systemsKaleb KEITHLEY2012-01-141-6/+58
| | | | | | | | | | | | | | | | | Emmanual Dreyfus abandoned his changes, seemingly because he couldn't get rfc.sh to correctly generate his changed patch set. Since Mac OS is an important port, I suggest we keep this change alive. (This change also works on the other BSDs too) Now with added Solaris support BUG: 764655 Change-Id: I6a9ab7383777f9a09ab5c9a6914f45eee43461fb Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.com/2617 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* fuse-bridge: preserve original mode and umaskLubomir Rintel2012-01-121-0/+110
| | | | | | | | | | | | | | | | | | | | FUSE used to interpret the umask itself. That was a bad idea, since there are cases where umask is not applied, such as when extended POSIX ACLs are present and default ACLs are set on parent directory. Thus, FUSE was changed to pass umask to operation handler itself in case the fuse server is initialized with FUSE_DONT_MASK. In case FUSE supports it, gluster client sends mode unmasked and umask separately ( masked mode is still sent, for compatibility with old servers). the mode as-is for compatibility with older clients. Change-Id: I55862b39a25261446f18ba0b3c03f85b41c4d722 Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com> Tested-by: Lubomir Rintel <lubo.rintel@gooddata.com> BUG: 765508 Reviewed-on: http://review.gluster.com/667 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* mount/fuse: Fix memory leaksPranith Kumar K2012-01-111-0/+3
| | | | | | | | | | Change-Id: Iff10650dc8234f9d8ca0472f2e1ea9c60fbd6d4e BUG: 773211 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2630 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@gluster.com>