From 5f59fbd81830a5f2157b3206d8413ba862aa5253 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 14 Mar 2012 16:45:21 +0530 Subject: cluster/stripe: fix {set/get}xattr query for dirs/symlink This patch fixes the following problems: * ENOENT returned for getxattr (xtime) on symlinks Non-data entities are created only on the first subvolume but getxattr fop winds to all subvols. This results in all subvols except the first one to return ENOENT which is propogated down the stack. * ENODATA returned for getxattr (xtime) on directory setxattr calls always wind to the first stripe subvolume. xtime getxattr invocation winds to all subvolumes but the xattr is present in only the first one, resulting in all subvols except the first one to return ENODATA. Fix For symlinks getxattr now always winds to the first subvol and for directories setxattr sets the xattr on all subvols. NOTE For directories the all-subvol-wind in setxattr is done only when request is from a special client (client-pid == -1) Change-Id: I9236345ef319506770d2034b840ee4ac04704b21 BUG: 801394 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.com/2948 Tested-by: Gluster Build System Reviewed-by: Shishir Gowda Reviewed-by: Anand Avati --- libglusterfs/src/iatt.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/iatt.h b/libglusterfs/src/iatt.h index b84eaa379c0..aac42e22abb 100644 --- a/libglusterfs/src/iatt.h +++ b/libglusterfs/src/iatt.h @@ -103,6 +103,8 @@ struct iatt { #define IA_PROT_SGID(prot) ((prot).sgid == 1) #define IA_PROT_STCKY(prot) ((prot).sticky == 1) +#define IA_FILE_OR_DIR(t) (IA_ISREG(t) || IA_ISDIR(t)) + static inline uint32_t ia_major (uint64_t ia_dev) { -- cgit