#define OBD_FAIL_LOV_INVALID_OSTIDX 0x1428
#define OBD_FAIL_LLITE_DELAY_TRUNCATE 0x1430
#define OBD_FAIL_LLITE_READ_PAUSE 0x1431
+#define OBD_FAIL_LLITE_FAULT_PAUSE 0x1432
#define OBD_FAIL_FID_INDIR 0x1501
#define OBD_FAIL_FID_INLMA 0x1502
if (result != 0)
RETURN(result);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_FAULT_PAUSE, cfs_fail_val);
+
/* must return locked page */
if (fio->ft_mkwrite) {
LASSERT(cfio->ft_vmpage != NULL);
* kernel after it has been deleted from Lustre, which avoids
* potential stale data reads. The seqlock allows us to see
* that a page was potentially deleted and catch the resulting
- * SIGBUS - see ll_filemap_fault() (LU-16160) */
- write_seqlock(&ll_i2info(inode)->lli_page_inv_lock);
- ClearPageUptodate(vmpage);
- write_sequnlock(&ll_i2info(inode)->lli_page_inv_lock);
-
+ * SIGBUS - see ll_filemap_fault() (LU-16160)
+ */
+ if (PageUptodate(vmpage)) {
+ write_seqlock(&ll_i2info(inode)->lli_page_inv_lock);
+ ClearPageUptodate(vmpage);
+ write_sequnlock(&ll_i2info(inode)->lli_page_inv_lock);
+ }
/*
* The reference from vmpage to cl_page is removed,
* but the reference back is still here. It is removed
result = rc;
if (result == -EAGAIN && io->ci_ndelay && !io->ci_iocb_nowait) {
- io->ci_need_restart = 1;
- result = 0;
+ if (!io->ci_tried_all_mirrors) {
+ io->ci_need_restart = 1;
+ result = 0;
+ } else {
+ result = -EIO;
+ }
}
if (result == 0)
}
run_test 156 "tot_granted miscount after client eviction"
+test_157()
+{
+ $LFS setstripe -i 0 -c 1 $DIR/$tfile || error "setstripe failed"
+ dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1
+ cancel_lru_locks osc
+
+#define OBD_FAIL_LLITE_FAULT_PAUSE 0x1432
+ $LCTL set_param fail_loc=0x80001432 fail_val=3
+ $MULTIOP $DIR/$tfile soO_RDWR:MRUc &
+ MULTIPID=$!
+ sleep 1
+ ost_evict_client
+ wait $MULTIPID
+ [[ $? == 135 ]] || error "multiop failed with not SIGBUS"
+}
+run_test 157 "eviction during mmaped i/o"
+
complete_test $SECONDS
check_and_cleanup_lustre
exit_status
}
run_test 398q "race dio with buffered i/o"
+test_398r() {
+ $LFS setstripe -i 0 -c 1 $DIR/$tfile || error "setstripe failed"
+ echo "hello, world" > $DIR/$tfile
+
+ cancel_lru_locks osc
+
+#define OBD_FAIL_OST_BRW_READ_BULK 0x20f
+ do_facet ost1 $LCTL set_param fail_loc=0x20f
+ cat $DIR/$tfile > /dev/null && error "cat should fail"
+ return 0
+}
+run_test 398r "i/o error on file read"
+
+test_398s() {
+ [[ $OSTCOUNT -ge 2 && "$ost1_HOST" = "$ost2_HOST" ]] ||
+ skip "remote OST"
+
+ $LFS mirror create -N -i 0 -c 1 -N -i 1 -c 1 $DIR/$tfile ||
+ error "mirror create failed"
+
+ echo "hello, world" > $DIR/$tfile
+ $LFS mirror resync $DIR/$tfile || error "mirror resync failed"
+
+ cancel_lru_locks osc
+
+#define OBD_FAIL_OST_BRW_READ_BULK 0x20f
+ do_facet ost1 $LCTL set_param fail_loc=0x20f
+ cat $DIR/$tfile > /dev/null && error "cat should fail"
+ return 0
+}
+run_test 398s "i/o error on mirror file read"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then