Whamcloud - gitweb
b=22190 return error on write if rdonly mode is on, don't reply if umount
authorMikhail Pershin <tappro@sun.com>
Fri, 9 Apr 2010 01:24:07 +0000 (18:24 -0700)
committerRobert Read <robert.read@oracle.com>
Fri, 9 Apr 2010 01:24:07 +0000 (18:24 -0700)
i=oleg

lustre/ost/ost_handler.c
lustre/tests/replay-single.sh

index 7751869..638536a 100644 (file)
@@ -1205,6 +1205,14 @@ out_bulk:
         if (desc)
                 ptlrpc_free_bulk(desc);
 out:
         if (desc)
                 ptlrpc_free_bulk(desc);
 out:
+       /* XXX: don't send reply if obd rdonly mode, this can cause data loss
+        * on client, see bug 22190. Remove this when async bulk will be done.
+        * Meanwhile, if this is umount then don't reply anything. */
+        if (req->rq_export->exp_obd->obd_no_transno) {
+                no_reply = req->rq_export->exp_obd->obd_stopping;
+                rc = -EIO;
+        }
+
         if (rc == 0) {
                 oti_to_request(oti, req);
                 target_committed_to_req(req);
         if (rc == 0) {
                 oti_to_request(oti, req);
                 target_committed_to_req(req);
index 1e4e91f..7dcad42 100755 (executable)
@@ -2043,6 +2043,19 @@ test_84a() {
 }
 run_test 84a "stale open during export disconnect"
 
 }
 run_test 84a "stale open during export disconnect"
 
+test_85() { # bug 22190
+    local fail=0
+    do_facet ost1 "lctl set_param -n obdfilter.${ost1_svc}.sync_journal 1"
+
+    replay_barrier ost1
+    lfs setstripe -i 0 -c 1 $DIR/$tfile
+    dd oflag=dsync if=/dev/urandom of=$DIR/$tfile bs=4k count=100 || fail=1
+    fail_abort ost1
+    echo "FAIL $fail"
+    [ $fail -ne 0 ] || error "Write was successful"
+}
+run_test 85 "ensure there is no reply on bulk write if obd is in rdonly mode"
+
 equals_msg `basename $0`: test complete, cleaning up
 check_and_cleanup_lustre
 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
 equals_msg `basename $0`: test complete, cleaning up
 check_and_cleanup_lustre
 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true