From eddb2069f3b0e122cbd034328d87e08e737f4c4e Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 8 Aug 2011 16:54:12 +0530 Subject: fuse-resolve: prevent linking of inodes of different inode-table 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 Reviewed-by: Shishir Gowda Reviewed-by: Anand Avati --- libglusterfs/src/inode.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index b098b2bca..382e97023 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -746,6 +746,15 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name, if (!table) return NULL; + if (parent) { + /* We should prevent inode linking between different + inode tables. This can cause errors which is very + hard to catch/debug. */ + if (inode->table != parent->table) { + GF_ASSERT (!"link attempted b/w inodes of diff table"); + } + } + link_inode = inode; if (!__is_inode_hashed (inode)) { -- cgit