From 9f0aaae0fb3759e7991d4ea042567d09f58ed436 Mon Sep 17 00:00:00 2001 From: wang di Date: Sun, 29 Mar 2015 17:35:47 -0700 Subject: [PATCH] LU-6413 lod: set FLAGS all stripes of striped dir Except permission and time, flags should be set on each stripe of striped dir as well, otherwise chattr can not set special flags (immutable etc) correctly on striped dir. Signed-off-by: wang di Change-Id: I8b3274b674bd1b8b41f95bb9299245aa8c2905c3 Reviewed-on: http://review.whamcloud.com/14278 Tested-by: Jenkins Reviewed-by: Alex Zhuravlev Reviewed-by: Lai Siyao Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/lod/lod_object.c | 6 ++++-- lustre/tests/sanity.sh | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index f8d3a00..2ba89c2 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -1176,7 +1176,8 @@ static int lod_declare_attr_set(const struct lu_env *env, RETURN(0); } else { if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE | - LA_ATIME | LA_MTIME | LA_CTIME))) + LA_ATIME | LA_MTIME | LA_CTIME | + LA_FLAGS))) RETURN(rc); } /* @@ -1267,7 +1268,8 @@ static int lod_attr_set(const struct lu_env *env, RETURN(0); } else { if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE | - LA_ATIME | LA_MTIME | LA_CTIME))) + LA_ATIME | LA_MTIME | LA_CTIME | + LA_FLAGS))) RETURN(rc); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 5d4cc9f..2ec1cee 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -12963,6 +12963,11 @@ test_striped_dir() { [ $(stat -c%h $DIR/$tdir/striped_dir) == '2' ] || error "nlink error after rmdir" + chattr +i $DIR/$tdir/striped_dir + createmany -o $DIR/$tdir/striped_dir/f 10 && + error "immutable flags not working under striped dir!" + chattr -i $DIR/$tdir/striped_dir + rmdir $DIR/$tdir/striped_dir || error "rmdir striped dir error" -- 1.8.3.1