From 095f62a963e9768a17e7b7382967f2e30f3879a8 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Mon, 3 Feb 2014 17:49:51 +0530 Subject: POSIX : gefattr fails and mount point become inaccessible Problem : getfattr fails and mount point becomes inaccessible while fetching glusterfs.ancestry.path key value for a gfid from aux-gfid-mount based mount point. Analysis : The caller of posix_make_ancestryfromgfid() function i.e. posix_get_ancestry_non_directory() is sending an incorrect type value as an argument leading to a crash in posix_make_ancestral_node() (head dirent pointer is NULL and an attempt to dereference causes seg fault). For a non directory operation this piece of code should not have been executed but due to incorrect type value this happened. Solution : In posix_make_ancestryfromgfid() call type is passed as logical or of type and POSIX_ANCESTRY_PATH instead of logical or of POSIX_ANCESTRY_PATH and POSX_ANCESTRY_DENTRY. Please note this patch is backport picked up from following patch: http://review.gluster.org/#/c/6892/ Change-Id: Iaf844bea91396c5e2ee295d5a082998fda66f0a9 BUG: 1060104 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/6892 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Reviewed-by: Vijay Bellur Reviewed-on: http://review.gluster.org/6921 --- xlators/storage/posix/src/posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index eae299763..2abe92835 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3276,7 +3276,7 @@ posix_get_ancestry_non_directory (xlator_t *this, inode_t *leaf_inode, dirpath + priv->base_path_length, pathlen, head, - POSIX_ANCESTRY_PATH | POSIX_ANCESTRY_DENTRY, + type | POSIX_ANCESTRY_PATH, pgfid, handle_size, priv->base_path, -- cgit