Whamcloud - gitweb
- avoid assertion if second open|create found orphan again
authortappro <tappro>
Tue, 31 Mar 2009 06:21:37 +0000 (06:21 +0000)
committertappro <tappro>
Tue, 31 Mar 2009 06:21:37 +0000 (06:21 +0000)
  b:18927
  i:rread,johann

lustre/mds/mds_unlink_open.c
lustre/tests/replay-dual.sh
lustre/tests/replay-single.sh

index d64a586..0e6d15a 100644 (file)
@@ -362,8 +362,10 @@ int mds_check_stale_orphan(struct obd_device *obd, struct ll_fid *fid)
         if (mds_inode_is_orphan(inode)) {
                 struct dentry *orphan;
 
-                /* The exactly same inode can't be orphan */
-                LASSERT(inode->i_generation != fid->generation);
+                /* bz18927: The exactly same inode can be marked as orphan
+                 * if there was open|creat replay and this is second one */
+                if (inode->i_generation == fid->generation)
+                        GOTO(unlock_child, rc);
 
                 if (mds_orphan_open_count(inode) > 0) {
                         CERROR("Orphan "LPU64"/%u is in use!\n",
index 122dc6d..eb830dd 100755 (executable)
@@ -442,6 +442,23 @@ test_20() { #16389
 }
 run_test 20 "recovery time is not increasing"
 
+test_22() { #bug 18927
+    multiop_bg_pause $MOUNT1/$tfile O_c || return 1
+    pid1=$!
+    multiop_bg_pause $MOUNT2/$tfile O_c || return 2
+    pid2=$!
+    rm -f $MOUNT1/$tfile
+    replay_barrier mds
+    fail mds
+    kill -USR1 $pid1
+    wait $pid1 || return 3
+    kill -USR1 $pid2
+    wait $pid2 || return 4
+    [ -e $MOUNT1/$tfile ] && return 5
+    return 0
+}
+run_test 22 "double open|creat in replay with open orphan from two mntp"
+
 equals_msg `basename $0`: test complete, cleaning up
 SLEEP=$((`date +%s` - $NOW))
 [ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
index e6cebcf..ed9a913 100755 (executable)
@@ -2029,6 +2029,22 @@ test_81b() {
 }
 run_test 81b "fail log_add during unlink recovery"
 
+test_82() { #bug 18927
+    multiop_bg_pause $DIR/$tfile O_c || return 1
+    pid1=$!
+    multiop_bg_pause $DIR/$tfile o:O_CREAT:O_RDONLY:_c || return 2
+    pid2=$!
+    rm -f $DIR/$tfile
+    replay_barrier mds
+    fail mds
+    kill -USR1 $pid1
+    wait $pid1 || return 3
+    kill -USR1 $pid2
+    wait $pid2 || return 4
+    [ -e $DIR/$tfile ] && return 5
+    return 0
+}
+run_test 82 "second open|creat in replay with open orphan"
 
 equals_msg `basename $0`: test complete, cleaning up
 check_and_cleanup_lustre