summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-bridge.h
Commit message (Collapse)AuthorAgeFilesLines
* fuse: make SELinux support configurableAnand Avati2012-05-291-2/+1
| | | | | | | | | | | | | 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: allow requests during mount (needed for SELinux labels)Csaba Henk2012-05-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "fuse: allow requests during mount (needed for SELinux labels)"Vijay Bellur2012-05-101-4/+1
| | | | This reverts commit 7d0397c2144810c8a396e00187a6617873c94002.
* clean up handling of special client pidsCsaba Henk2012-04-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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-231-1/+4
| | | | | | | | | 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>
* fuse-bridge/fd-migration: document migration failures in fdctx.Raghavendra G2012-04-041-0/+1
| | | | | | | | | 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-221-1/+3
| | | | | | | | | | | | | 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>
* fuse-bridge/graph-cleanup: don't provide a cbk for cleanup syncop taskRaghavendra G2012-03-141-3/+0
| | | | | | | | | | | | | 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-071-1/+0
| | | | | | | | | | | | | | | | - 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>
* fuse-bridge: Handle graph-switch.Raghavendra G2012-02-211-4/+36
| | | | | | | | | | | | | | | | | 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>
* core: add an extra flag to readv()/writev() APIAmar Tumballi2012-02-141-0/+1
| | | | | | | | | | | | 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-081-14/+22
| | | | | | | | | | | | | | 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>
* core: add 'fremovexattr()' fopAmar Tumballi2012-01-251-0/+1
| | | | | | | | | | | 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: GFID filehandle based backend and anonymous FDsAnand Avati2012-01-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fuse: bring in the reverse invalidationAmar Tumballi2011-12-121-0/+11
| | | | | | | | | | | | | | | Thanks to Csaba Henk <csaba@gluster.com> for the patch Currently one can invalidate the inodes using 'setxattr()' with key 'inode-invalidate' (and any value). This can be further extended to do a purge of inode table itself. Change-Id: I165d5d585ed808b9e463ac0aad859ec64568c7a2 BUG: 762277 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/324 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* mount/fuse: Inherit direct-io-mode values from fds alreadyRaghavendra G2011-12-011-0/+7
| | | | | | | | | | | | | | | | opened, for a new fd being opened. When an fd is being opened, it inherits direct-io-mode characterstics (either enabled or disabled) from the fds already opened on inode. If none are opened and user has not specified the mode through cmdline options, default mode is used. Change-Id: I0c9e959100e9130e46bbd16d63eca278260635b4 BUG: 801 Reviewed-on: http://review.gluster.com/55 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* fuse: enable kernel read-only modeKaushal M2011-11-221-0/+1
| | | | | | | | | | | | | Enables kernel read-only mode on mounting with '-oro' and disables the gluster read-only translator from being loaded. As a result, '-oro' is reported correctly in the mount options. Change-Id: If94d97836b13668974cfac61b6e5d52e19880e10 BUG: 3742 Reviewed-on: http://review.gluster.com/655 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Csaba Henk <csaba@gluster.com>
* fuse: flip xattr key from user to trusted namespace for certainVenky Shankar2011-10-281-0/+3
| | | | | | | | | | | | | | | | | | | | clients. This is needed for gsyncd/hadoop-plugin running as non-super user to be able to request extended attributes under trusted namespace. Request for a key is made under 'user.' namespace and is flipped by fuse xlator for specific xattr name to the corresponding 'trusted.' extended attribute. Both applications set a identifier (client-pid) while doing a FUSE mount, which is checked by get/set/remove interfaces in FUSE translator. Change-Id: I72f77a5dd1ee1d69c8b0e09209449348dbcf879a BUG: 3701 Reviewed-on: http://review.gluster.com/563 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* add --user-map-root optionCsaba Henk2011-09-121-0/+1
| | | | | | | | | | | | | | | | | | This makes client fake that given user is a superuser, by changing FUSE requests coming with uid of user so that uid is set to 0. User can be given in numeric form, in which case it's treated as an uid directly, or else it's tried to be resolved to an uid with getpwnam(3). Implies --acl. Change-Id: I2d5a3d3e178be7ffdf22b46a56f33a7eeaaa7fe1 BUG: 3242 Reviewed-on: http://review.gluster.com/127 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Change Copyright current yearPranith Kumar K2011-08-101-1/+1
| | | | | | | | Change-Id: I2d10f2be44f518f496427f257988f1858e888084 BUG: 3348 Reviewed-on: http://review.gluster.com/200 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* LICENSE: s/GNU Affero General Public/GNU General Public/Pranith Kumar K2011-08-061-3/+3
| | | | | | | | Change-Id: I3914467611e573cccee0d22df93920cf1b2eb79f BUG: 3348 Reviewed-on: http://review.gluster.com/182 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* fuse: introduce "noacl" option to disable ACL checksAnand Avati2011-07-081-3/+3
| | | | | | | Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2815 (Server-enforced ACLs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2815
* mnt/fuse: Do a pthread_cond_broadcast for both CHILD_UP and CHILD_DOWN events.Raghavendra G2011-07-011-1/+1
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3091 (rebalance fails with "transport endpoint not connected" in 3.2.1 rdma set-up) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3091
* fuse: NetBSD portability fixesAnand Avati2011-05-301-1/+1
| | | | | | | | | | | Make sure NetBSD pulls proper FUSE header Thanks to: Emmanuel Dreyfus <manu@netbsd.org> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2923 (NetBSD port) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2923
* glusterfsd: log enhancementAmar Tumballi2011-03-171-1/+0
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
* fuse-resolve: correction in resolve logicAmar Tumballi2011-02-221-8/+10
| | | | | | | | | | | | * bring in soft (gfid based) and hard (path based) resolving * 'fd' resolving to new graph is not yet done. * fuse-resolve works similar to server-resolve Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2281 (I/O operations exit when add-brick is done) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2281
* implement "--client-pid" option which can forcibly set the pid value in ↵Csaba Henk2011-01-271-0/+3
| | | | | | | | | | messages to a predefined value Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2310 (georeplication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2310
* Copyright changesVijay Bellur2010-10-111-1/+1
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
* Change GNU GPL to GNU AGPLPranith K2010-10-041-3/+3
| | | | | | | | Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1388 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1388
* Add log-level option to command volume setshishir gowda2010-10-041-1/+0
| | | | | | | | | | | log-level option to set brick's log-level client-log-level to set client's log-level Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1789 (add log-level options to volume set) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1789
* Changes to replace flock with gf_flock across GlusterFS.Pavan Sondur2010-10-011-1/+1
| | | | | | | | Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 865 (Add locks recovery support in GlusterFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=865
* gfid: set request gfids for new entries in fuseAnand Avati2010-09-041-0/+3
| | | | | | | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
* Revert "fuse: introduce pre-test micro-framework, check for ↵v3.1.0qa15Vijay Bellur2010-09-031-4/+0
| | | | | | execve-over-direct-IO" This reverts commit 588d807bdcbf5ed4df4d903428ab701479e9f8ac.
* fuse: introduce pre-test micro-framework, check for execve-over-direct-IOCsaba Henk2010-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of some potential FUSE features in the actual kernel-side FUSE implementation we run on is not always straightforward. More precisely, it is straightforward only if there is a dedicated feature flag or protocol revision number. In the other cases we are left to clumsy and platform specific hacks which wire in 3rd-party software revision numbers into our source... at least, if we insist on sticking to (the otherwise venerable) KISS principle. However, here we go for another route, loosely inspired by the way autotools provide an abstraction layer for our build system over the gory details of platform specific build environments. At start time, we use a preliminary set of FUSE operations which overlay the standard ones such that apart from the "usual stuff", they also present some synthetic files to the FUSE client (kernel). Then we spawn some test programs which perform the needed tests on these synthetic files to evaulate the FUSE implementation in terms of the features in question. According to the result of the test programs, we set the respective parameters of the fuse xlator; when the testing phase is over, the FUSE operation set is replaced by the standard one. As of now, we use this approach to test whether execve(2) works with direct I/O. If yes, and if glusterfs is used with --enable-direct-io-mode, then we let direct I/O for files opened for reading; if no, then we restrict direct I/O only to writing files. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 801 (Direct io-mode support and related changes in caching translators.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=801
* check whether xlator is NULL in FUSE_FOP macroRaghavendra Bhat2010-08-211-4/+13
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1407 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1407
* logging enhancementsAmar Tumballi2010-08-121-0/+2
| | | | | | | | | | | | | | | | * per translator loglevel introduced, if set, it will override process wide log level. * with extended attribute 'trusted.glusterfs.<xlator-name>.set-log-level' with the value being '<LOGLEVEL>', one can change log level of particular translator. * with extended attribute 'trusted.glusterfs.syslog' with the value '<BOOLEAN>', one can enable disable syslog for gluster Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 601 (Enable changing 'log-level' of GlusterFS process at runtime) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=601
* fuse resolve related changesAmar Tumballi2010-08-111-0/+277
Now fuse is fully complaint with DVM, as even if there is a fop request on inode belonging to old graph, it will be resolved corresponding to new graph and operations will be performed wrt. new graph, which makes DVM truely spontaneous. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1240 (DVM: after graph change, inodes should resolve to new inode-table) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1240