From 49f8cf05decf8b3eb639923d0cd7ac53c2546360 Mon Sep 17 00:00:00 2001
From: bobijam <bobijam>
Date: Mon, 1 Sep 2008 01:54:20 +0000
Subject: [PATCH] Branch b1_8_gate b=16570 i=h.huang, robert.read

Make MDS_SETXATTR request replayable.
---
 lustre/tests/replay-single.sh | 38 ++++++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh
index e9cb38987e..2d37204bfc 100755
--- a/lustre/tests/replay-single.sh
+++ b/lustre/tests/replay-single.sh
@@ -312,7 +312,6 @@ test_15() {
 }
 run_test 15 "open(O_CREAT), unlink |X|  touch new, close"
 
-
 test_16() {
     replay_barrier mds
     mcreate $DIR/$tfile
@@ -1258,7 +1257,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"
@@ -1271,7 +1270,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