From: Mikhail Pershin Date: Fri, 9 Apr 2010 01:24:07 +0000 (-0700) Subject: b=22190 return error on write if rdonly mode is on, don't reply if umount X-Git-Tag: 1.10.0.40~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c7515002525bb10ef51c2bb8e5dc23cfef7bc484 b=22190 return error on write if rdonly mode is on, don't reply if umount i=oleg --- diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 7751869..638536a 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -1205,6 +1205,14 @@ out_bulk: 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); diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 1e4e91f..7dcad42 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -2043,6 +2043,19 @@ test_84a() { } 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