summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-resolve.c
Commit message (Collapse)AuthorAgeFilesLines
* fuse-resolve: loc_wipe() after inode_link()Anand Avati2014-04-201-2/+2
| | | | | | | | | | | | the inode to be linked may have the last ref. loc_wipe() can destroy it before inode_link() gets to ref it. Change-Id: Ic2d44084e6e9c8289f35cae82c8e4575af105398 BUG: 1089216 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/7505 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* mount/fuse: Fix the NULL dereference errors reported by coverity.Poornima2014-02-171-0/+2
| | | | | | | | | Change-Id: I9df57e11b115d7323931735c86b586c0b65fa414 BUG: 789278 Signed-off-by: Poornima <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/6990 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* mount/fuse: perform lookup() on inodes linked through readdirplusAnand Avati2013-08-231-7/+23
| | | | | | | | | | | | | Some xlators still require lookup() fop to be sent for proper working. This patch remembers inodes which have been linked through readdiprlus and makes the resolver send lookups on them. Change-Id: Ibe8a04a659539d90dfc794521b51bf2bda017a0b BUG: 979910 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5267 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* fuse-bridge: fix posix-only configurationAnand Avati2012-11-191-0/+1
| | | | | | | | | | | | | | Recent changes in fuse-resolver had broken the use case of having a trivial configuration with only storage/posix translator. Fix it and include a regression test to avoid breakage in the future. Change-Id: I85cbcac4b5c2d3517dd03fd3dc6d07610697981b BUG: 868478 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4114 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* fuse: create a new fd during fd-migration.Raghavendra G2012-10-021-26/+120
| | | | | | | | | | | | | | | | | | | | | | Migration of fd to new graph involves creation of a new fd to be used only for calls sent in that graph. Earlier approach of using same fd across all graphs, with the associated inode always guaranteed to be the one valid in currently active graph, had issues because of the broken immutability of the association of fd with an inode (for the life of fd). With this patch, there will be a basefd, which the kernel will be aware of. This basefd, contains a mapping of an fd which is valid in currently active graph. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Change-Id: I2b459f05bc2690a66498be107fad6444e3158138 BUG: 802414 Reviewed-on: http://review.gluster.org/3566 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* All: License message changeVarun Shastry2012-09-131-7/+6
| | | | | | | | | | | | License message changed for server-side, dual license GPLV2 and LGPLv3+. Change-Id: Ia9e53061b9d2df3b3ef3bc9778dceff77db46a09 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* All: License message changeVarun Shastry2012-08-281-14/+5
| | | | | | | | | | | | | | | | | | The license message is changed to Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. Change-Id: I07d2b63ed5fbbbd1884f1e74f2dd56013d15b0f4 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3858 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mount/fuse: ignore any erros that might've happened while resolving entry in ↵Raghavendra G2012-08-031-3/+16
| | | | | | | | | | | | | | | | | | | resolver. One error we hit was absence of gfid on backend. While the lookup code-path generates a new uuid and sets it on file, resolver code doesn't do that. Since, functionally (atleast after resolving parent inode, we would be resolving the path in new-graph) both resolver and lookup does same work, it would be no harm in ignoring errors during resolving the entry. This would help us to continue with the _extra_ work (like healing gfid as of now) in fuse_lookup_resume. Change-Id: If46d5e07c32e67b5744287a6ef55d0b0fe347689 BUG: 821138 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3344 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-resolve: consider cases where an entry should be resolved even when ↵Raghavendra G2012-08-031-0/+13
| | | | | | | | | | | | | | | 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. BUG: 804592 Change-Id: I5829278e27435e06785a923ce8776616cedfb519 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3710 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Revert "fuse-resolve: consider cases where an entry should be resolved even ↵Anand Avati2012-05-231-6/+0
| | | | | | | | | | | when parent belongs to active itable." This reverts commit 595bc33c1d0a3a6fe3d54d3eb876ac0b336d9dea Change-Id: I6c67404d4ff0bc83cfac83d786bc6e66d221a84a Reviewed-on: http://review.gluster.com/3422 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-resolve: Attempt fd-migration in resolver, if migrationRaghavendra G2012-05-151-9/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | was never attempted. Since fd is always associated with an inode, we can create an fd only after resolver resolves an inode. So, there is a possibility that graph-switch can happen after resolver kicks in, but before it can complete, thereby resulting in the newly created fd not migrated to new graph. So, instead of migrating fds only during graph-switch, we give a second chance during fd-resolution. As an example, consider following sequence of events during a create call: 1. create wants to resolve parent inode, hence it starts resolution for parent 2. graph-switch happens (it can happen since fuse-request reader thread returns after winding lookup calls) 3. fd-migration of all the fds which are currently in fdtable is attempted (Note that the fd corresponding to current create call is not yet created and added to fd-table, hence it will not be migrated as part of graph switch) 4. resolution of parent triggered as part of create, completes 5. fd is created in fuse_create_resume and this fd is not migrated to new graph 6. Any future fops on this fd will fail with EBADF errors (create call itself will succeed) Change-Id: Iae06ecfaca24eaacb2e166ffefbbbb57446332ba BUG: 804592 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3181 Tested-by: Gluster Build System <jenkins@build.gluster.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>
* fuse-bridge/fd-migration: document migration failures in fdctx.Raghavendra G2012-04-041-3/+17
| | | | | | | | | 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-4/+4
| | | | | | | | | | | | | 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: Handle graph-switch.Raghavendra G2012-02-211-20/+18
| | | | | | | | | | | | | | | | | 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>
* fuse: fix resolver to handle graph switches properlyAnand Avati2012-02-081-248/+183
| | | | | | | | | | | | | | 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: GFID filehandle based backend and anonymous FDsAnand Avati2012-01-201-288/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mount/fuse: Inherit direct-io-mode values from fds alreadyRaghavendra G2011-12-011-13/+30
| | | | | | | | | | | | | | | | 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>
* Eliminate many "var set but not used" warnings with newer gcc.Jeff Darcy2011-09-071-2/+0
| | | | | | | | | | | | | | | | This fixes ~200 such warnings, but leaves three categories untouched. (1) Rpcgen code. (2) Macros which set variables in the outer (calling function) scope. (3) Variables which are set via function calls which may have side effects. Change-Id: I6554555f78ed26134251504b038da7e94adacbcd BUG: 2550 Reviewed-on: http://review.gluster.com/371 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@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>
* fuse-resolve: prevent linking of inodes of different inode-tableAmar Tumballi2011-08-101-25/+31
| | | | | | | | | | | | | | | | | | This can happen in deep_resolve_cbk, which happens after a graph switch. Root cause was because the graph change happened while a FOP was in transit and by the time the call came back, the active translator of fuse is now changed. Fix is to make sure the resolve operation happens on a given inode table, instead of taking the latest graph of fuse for each operation Change-Id: Idd6e2d5c2d5fc5d571f7a1fbc174e210babf8a2b BUG: 3355 Reviewed-on: http://review.gluster.com/195 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@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: fix inode-leaks in fuse_lookup_and_resume codepath.Raghavendra G2011-07-111-9/+27
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2525 ([glusterfs-3.1.3qa8]: inode leak in rdma) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2525
* fuse-resolve: correction in resolve logicAmar Tumballi2011-02-221-66/+187
| | | | | | | | | | | | * 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
* check the return value properly after calling inode_pathRaghavendra Bhat2010-12-121-1/+1
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2203 ([glusterfs 3.1.1]: Core generated with Segmentation fault in afr-open.c) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2203
* 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
* fuse-resolve: remove stale codeAmar Tumballi2010-09-231-192/+6
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@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
* fuse-resolve: don't resolve fd to new graph for nowAmar Tumballi2010-09-221-1/+5
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1674 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1674
* fuse resolve to return if resolve not successfulAmar Tumballi2010-09-071-1/+10
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1406 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1406
* gfid: set request gfids for new entries in fuseAnand Avati2010-09-041-0/+25
| | | | | | | | | 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
* fuse: prevent NULL dereference in case resolve on path failed.Amar Tumballi2010-08-181-3/+1
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1391 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1391
* fuse resolve related changesAmar Tumballi2010-08-111-0/+747
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