When fsync races with truncate, we'd continue to other OST object's
fsync even some stripe fsync returns -ENOENT, so that on client it
could potentially discard caching pages by calling
osc_io_fsync_start()->osc_cache_writebase_range().
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Test-Parameters: testlist=sanity ostcount=4 env=ONLY="273b 273c",ONLY_REPEAT=120
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I457ba80063086e310df55aaa22778b51a6ea211e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50005
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
#define OBD_FAIL_OSD_SCRUB_STALE 0x19f
#define OBD_FAIL_OFD_SET_OID 0x1e0
+#define OBD_FAIL_OFD_COMMITRW_DELAY 0x1e1
#define OBD_FAIL_OST 0x200
#define OBD_FAIL_OST_CONNECT_NET 0x201
ENTRY;
list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
rc = iofunc(sub->sub_env, &sub->sub_io);
- if (rc)
+ if (rc) {
+ /**
+ * fsync race with truncate, we'd continue to other
+ * OST object's fsync to potentially discard
+ * caching pages (osc_cache_writeback_range).
+ */
+ if (rc == -ENOENT && parent->ci_type == CIT_FSYNC)
+ continue;
break;
+ }
if (parent->ci_result == 0)
parent->ci_result = sub->sub_io.ci_result;
}
retry:
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OFD_COMMITRW_DELAY, cfs_fail_val);
+
th = ofd_trans_create(env, ofd);
if (IS_ERR(th))
GOTO(out, rc = PTR_ERR(th));
}
run_test 273b "DoM: race writeback and object destroy"
+test_273c() {
+ mkdir -p $DIR/$tdir
+ $LFS setstripe -E 1M -E-1 -c-1 $DIR/$tdir
+
+ #define OBD_FAIL_OFD_COMMITRW_DELAY 0x1e1
+ do_facet ost1 $LCTL set_param fail_loc=0x800001e1 fail_val=2
+
+ $MULTIOP $DIR/$tdir/$tfile Ouw2097152c
+}
+run_test 273c "race writeback and object destroy"
+
test_275() {
remote_ost_nodsh && skip "remote OST with nodsh"
[ $OST1_VERSION -lt $(version_code 2.10.57) ] &&