From aff29f454596f7159a8ed219eeff806c1c18a6d3 Mon Sep 17 00:00:00 2001 From: bobijam <bobijam> Date: Mon, 1 Sep 2008 01:46:21 +0000 Subject: [PATCH] Branch b1_6 b=16570 i=robert.read, h.huang Make MDS_SETXATTR request replayable. --- lustre/mds/handler.c | 1 + lustre/tests/replay-single.sh | 37 +++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 7dfe16dd4b..d9f9a0daf7 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1343,6 +1343,7 @@ static int mds_filter_recovery_request(struct ptlrpc_request *req, case MDS_SYNC: /* used in unmounting */ case OBD_PING: case MDS_REINT: + case MDS_SETXATTR: case LDLM_ENQUEUE: *process = target_queue_recovery_request(req, obd); RETURN(0); diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 6a40f33908..95ba131249 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -1249,7 +1249,7 @@ test_57() { run_test 57 "test recovery from llog for setattr op" #recovery many mds-ost setattr from llog -test_58() { +test_58a() { mkdir -p $DIR/$tdir #define OBD_FAIL_MDS_OST_SETATTR 0x12c do_facet mds "lctl set_param fail_loc=0x8000012c" @@ -1262,7 +1262,40 @@ test_58() { unlinkmany $DIR/$tdir/$tfile-%d 2500 rmdir $DIR/$tdir } -run_test 58 "test recovery from llog for setattr op (test llog_gen_rec)" +run_test 58a "test recovery from llog for setattr op (test llog_gen_rec)" + +test_58b() { + mount_client $MOUNT2 + mkdir -p $DIR/$tdir + touch $DIR/$tdir/$tfile + replay_barrier mds + setfattr -n trusted.foo -v bar $DIR/$tdir/$tfile + fail mds + VAL=`getfattr --absolute-names --only-value -n trusted.foo $MOUNT2/$tdir/$tfile` + [ x$VAL = x"bar" ] || return 1 + rm -f $DIR/$tdir/$tfile + rmdir $DIR/$tdir + zconf_umount `hostname` $MOUNT2 +} +run_test 58b "test replay of setxattr op" + +test_58c() { # bug 16570 + mount_client $MOUNT2 + mkdir -p $DIR/$tdir + touch $DIR/$tdir/$tfile + drop_request "setfattr -n trusted.foo -v bar $DIR/$tdir/$tfile" || \ + return 1 + VAL=`getfattr --absolute-names --only-value -n trusted.foo $MOUNT2/$tdir/$tfile` + [ x$VAL = x"bar" ] || return 2 + drop_reint_reply "setfattr -n trusted.foo1 -v bar1 $DIR/$tdir/$tfile" || \ + return 3 + VAL=`getfattr --absolute-names --only-value -n trusted.foo1 $MOUNT2/$tdir/$tfile` + [ x$VAL = x"bar1" ] || return 4 + rm -f $DIR/$tdir/$tfile + rmdir $DIR/$tdir + zconf_umount `hostname` $MOUNT2 +} +run_test 58c "resend/reconstruct setxattr op" # log_commit_thread vs filter_destroy race used to lead to import use after free # bug 11658 -- GitLab