#define OBD_FAIL_OSC_NO_SIZE_DATA 0x415
#define OBD_FAIL_OSC_DELAY_CANCEL 0x416
#define OBD_FAIL_OSC_SLOW_PAGE_EVICT 0x417
+#define OBD_FAIL_OSC_FIEMAP 0x418
#define OBD_FAIL_OSC_MARK_COMPRESSED 0x419
#define OBD_FAIL_PTLRPC 0x500
LDLM_FL_BLOCK_GRANTED | LDLM_FL_LVB_READY,
&resid, LDLM_EXTENT, &policy,
LCK_PR | LCK_PW, &lockh);
+ fmkey->lfik_oa.o_valid |= OBD_MD_FLFLAGS;
if (mode) { /* lock is cached on client */
+ fmkey->lfik_oa.o_flags &= ~OBD_FL_SRVLOCK;
if (mode != LCK_PR) {
ldlm_lock_addref(&lockh, LCK_PR);
ldlm_lock_decref(&lockh, LCK_PW);
}
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_FIEMAP, cfs_fail_val);
} else { /* no cached lock, needs acquire lock on server side */
- fmkey->lfik_oa.o_valid |= OBD_MD_FLFLAGS;
fmkey->lfik_oa.o_flags |= OBD_FL_SRVLOCK;
}
}
run_test 130g "FIEMAP (overstripe file)"
+test_130h() {
+ (( OSTCOUNT < 2 )) && skip_env "need 2 OSTs"
+
+ $LFS setstripe -o 0,1 -S 1M $DIR/$tfile
+ $LFS getstripe $DIR/$tfile
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=2
+ $LCTL set_param ldlm.namespaces.*-OST0000-osc-*.lru_size=clear
+ sleep 1
+ local before=$(date +%s)
+ ##define OBD_FAIL_OSC_FIEMAP 0x418
+ $LCTL set_param fail_loc=0x80000418 fail_val=5
+ checkfiemap $DIR/$tfile $((2 * 1024 * 1024)) &
+ sleep 1
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=3
+ wait
+ $LCTL set_param fail_loc=0 fail_val=0
+ # check for client eviction
+ local evict=$($LCTL get_param osc.$FSNAME-OST0001-osc-f*.state |
+ awk -F"[ [,]" '/EVICTED ]$/ { if (mx<$5) {mx=$5;} } END { print mx }')
+ [ -z "$evict" ] || [[ $evict -le $before ]] || error "eviction happened"
+}
+run_test 130h "FIEMAP deadlock"
+
# Test for writev/readv
test_131a() {
rwv -f $DIR/$tfile -w -n 3 524288 1048576 1572864 ||