ALWAYS_EXCEPT="$SANITYN_EXCEPT "
# bug number for skipped test: LU-7105
-ALWAYS_EXCEPT+=" 28"
+ALWAYS_EXCEPT+=" 28 "
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
+# skip tests for PPC until they are fixed
+if [[ $(uname -m) = ppc64 ]]; then
+ # bug number: LU-11597 LU-11787
+ ALWAYS_EXCEPT+=" 16a 71a"
+fi
+
if [ $mds1_FSTYPE = "zfs" ]; then
# LU-2829 / LU-2887 - make allowances for ZFS slowness
TEST33_NFILES=${TEST33_NFILES:-1000}
rm -f $file1
$LFS setstripe -c -1 $file1 # b=10919
- fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 $file1 $file2 \
- || error "fsx failed"
+ fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 $file1 $file2 ||
+ error "fsx failed"
rm -f $file1
# O_DIRECT reads and writes must be aligned to the device block size.
lfs setstripe -c -1 $file1 # b=10919
# -o is set to 8192 because writes < 1 page and between 1 and 2 pages
# create a mix of tiny writes & normal writes
- fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -o 8192 -S 0 $file1 \
- $file2 || error "fsx with tiny write failed."
+ fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -o 8192 -S 0 \
+ $file1 $file2 || error "fsx with tiny write failed."
}
run_test 16b "$FSXNUM iterations of dual-mount fsx at small size"
set_osd_param $list '' writethrough_cache_enable 0
$LFS setstripe -c -1 $file1 # b=10919
- fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 $file1 $file2 \
- || error "fsx failed"
+ fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 $file1 $file2 ||
+ error "fsx failed"
rm -f $file1
set_osd_param $list '' read_cache_enable 1
}
run_test 16c "verify data consistency on ldiskfs with cache disabled (b=17397)"
+test_16d() {
+ local file1=$DIR1/$tfile
+ local file2=$DIR2/$tfile
+ local file3=$DIR1/file
+ local stripe_size=$(do_facet $SINGLEMDS \
+ "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize")
+
+ # to allocate grant because it may run out due to test_15.
+ $LFS setstripe -c -1 $file1
+ dd if=/dev/zero of=$file1 bs=$stripe_size count=$OSTCOUNT oflag=sync
+ dd if=/dev/zero of=$file2 bs=$stripe_size count=$OSTCOUNT oflag=sync
+ rm -f $file1
+
+ local tmpfile=`mktemp`
+ $LFS setstripe -c -1 $file1 # b=10919
+ $LCTL set_param ldlm.namespaces.*.lru_size=clear
+
+ # direct write on one client and direct read from another
+ dd if=/dev/urandom of=$file1 bs=1M count=100 oflag=direct
+ dd if=$file2 of=$tmpfile iflag=direct bs=1M
+ diff $file1 $tmpfile || error "file different(1)"
+ rm -f $file1
+
+ # buffer write on one client, but direct read from another
+ dd if=$tmpfile of=$file1 bs=1M count=100
+ dd if=$file2 of=$file3 bs=1M iflag=direct count=100
+ diff $file3 $tmpfile || error "file different(2)"
+
+ rm -f $file3 $file2 $file1
+ # direct write on one client
+ dd if=$tmpfile of=$file1 bs=1M count=100 oflag=direct
+ # buffer read from another client
+ dd if=$file2 of=$file3 bs=1M count=100
+ diff $file3 $tmpfile || error "file different(3)"
+
+ rm -f $file1 $file2 $file3 $tmpfile
+
+}
+run_test 16d "Verify DIO and buffer IO with two clients"
+
+test_16e() { # LU-13227
+ local file1=$DIR1/$tfile
+ local file2=$DIR2/$tfile
+
+ # client1 write 10M data
+ dd if=/dev/zero of=$file1 bs=1M count=10
+ # drop locks
+ cancel_lru_locks osc > /dev/null
+ # use lockahead to generate one PW lock to keep LVB loaded.
+ $LFS ladvise -a lockahead --start 0 --length 1M \
+ --mode WRITE $file1
+ # direct write to extend file size on client2
+ dd if=/dev/zero of=$file2 bs=1M seek=20 count=1 \
+ oflag=direct conv=notrunc
+ local filesize=$(stat -c %s $file2)
+ [ "$filesize" -eq 22020096 ] ||
+ error "expected filesize 22020096 got $filesize"
+ rm -f $file1
+}
+run_test 16e "Verify size consistency for O_DIRECT write"
test_17() { # bug 3513, 3667
remote_ost_nodsh && skip "remote OST with nodsh" && return
excepts="$excepts -e $(($(printf %d \'$idx)-96))"
done
- $LUSTRE/tests/mmap_sanity -d $MOUNT1 -m $MOUNT2 $excepts
+ excepts="$excepts -e 7 -e 8 -e 9"
+ $LUSTRE/tests/mmap_sanity -d $MOUNT1 -m $MOUNT2 $excepts ||
+ error "mmap_sanity test failed"
sync; sleep 1; sync
}
run_test 18 "mmap sanity check ================================="
run_test 19 "test concurrent uncached read races ==============="
test_20() {
- test_mkdir $DIR1/d20
- cancel_lru_locks $OSC
- CNT=$((`lctl get_param -n llite.*.dump_page_cache | wc -l`))
- $MULTIOP $DIR1/f20 Ow8190c
- $MULTIOP $DIR2/f20 Oz8194w8190c
- $MULTIOP $DIR1/f20 Oz0r8190c
- cancel_lru_locks $OSC
- CNTD=$((`lctl get_param -n llite.*.dump_page_cache | wc -l` - $CNT))
- [ $CNTD -gt 0 ] && \
- error $CNTD" page left in cache after lock cancel" || true
+ test_mkdir $DIR1/$tdir
+ cancel_lru_locks
+ CNT=$($LCTL get_param -n llite.*.dump_page_cache | wc -l)
+ $MULTIOP $DIR1/$tdir/$tfile Ow8190c
+ $MULTIOP $DIR2/$tdir/$tfile Oz8194w8190c
+ $MULTIOP $DIR1/$tdir/$tfile Oz0r8190c
+ cancel_lru_locks
+ CNT2=$($LCTL get_param -n llite.*.dump_page_cache | wc -l)
+ [[ $CNT2 == $CNT ]] ||
+ error $((CNT2 - CNT))" page left in cache after lock cancel"
}
run_test 20 "test extra readahead page left in cache ===="
[ "$MDS1_VERSION" -lt $(version_code 2.7.63) ] &&
skip "DNE CoS not supported"
+ # LU-13522
+ stop mds1
+ start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS || error "start mds1 failed"
+
local sync_count
mkdir $DIR/$tdir
remote_mds_nodsh && skip "remote MDS with nodsh" && return
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
touch $DIR2
mkdir $DIR1/$tfile &
PID1=$!; pdo_sched
# all operations above shouldn't wait the first one
check_pdo_conflict $PID1 || error "parallel operation is blocked"
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
rm -rf $DIR/$tfile*
return 0
remote_mds_nodsh && skip "remote MDS with nodsh" && return
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
touch $DIR1/$tfile &
PID1=$!; pdo_sched
# open|create
# all operations above shouldn't wait the first one
check_pdo_conflict $PID1 || error "parallel operation is blocked"
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
rm -rf $DIR/$tfile*
return 0
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile $DIR1/$tfile-0 &
PID1=$!; pdo_sched
# open|create
# all operations above shouldn't wait the first one
check_pdo_conflict $PID1 || error "parallel operation is blocked"
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
rm -rf $DIR/$tfile*
return 0
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$!; pdo_sched
# open|create
# all operations above shouldn't wait the first one
check_pdo_conflict $PID1 || error "parallel operation is blocked"
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
return 0
}
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-0 &
PID1=$!; pdo_sched
# open|create
# all operations above shouldn't wait the first one
check_pdo_conflict $PID1 || error "parallel operation is blocked"
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
rm -rf $DIR/$tfile*
return 0
test_41a() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
mkdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; echo "mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "mkdir must fail"
rm -rf $DIR/$tfile*
test_41b() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "create must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
link $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "link must fail"
rm -rf $DIR/$tfile*
test_41d() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
rm $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "unlink must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
mv $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
test_41f() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-2 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
test_41g() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
rm -rf $DIR/$tfile*
test_41h() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
test_42a() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
mkdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "mkdir must fail"
rm -rf $DIR/$tfile*
test_42b() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "create must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
link $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "link must fail"
rm -rf $DIR/$tfile*
test_42d() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
rmdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "unlink must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
mv -T $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "rename must fail"
rm -rf $DIR/$tfile*
test_42f() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-2 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
test_42g() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
rm -rf $DIR/$tfile*
test_42h() {
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mkdir $DIR1/$tfile &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
}
run_test 42h "pdirops: mkdir vs readdir =============="
-# test 43: unlink and blocking operations
+# test 43: rmdir,mkdir won't return -EEXIST
test_43a() {
- pdo_lru_clear
- touch $DIR1/$tfile
-#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
- rm $DIR1/$tfile &
- PID1=$! ; pdo_sched
- mkdir $DIR2/$tfile &
- PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
- check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
- wait $PID2 ; [ $? -eq 0 ] || error "mkdir must succeed"
- rm -rf $DIR/$tfile*
+ for i in {1..1000}; do
+ mkdir $DIR1/$tdir || error "mkdir $tdir failed"
+ rmdir $DIR2/$tdir || error "rmdir $tdir failed"
+ done
return 0
}
-run_test 43a "pdirops: unlink vs mkdir =============="
+run_test 43a "rmdir,mkdir doesn't return -EEXIST =============="
test_43b() {
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "create must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
link $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "link must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
rm $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "unlink must fail"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
mv -u $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-2 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "rename must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "stat must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
rm $DIR1/$tfile &
PID1=$! ; pdo_sched
$LFS mkdir -i 1 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 &&
{ wait $PID1; error "remote mkdir isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "remote mkdir must succeed"
}
run_test 43i "pdirops: unlink vs remote mkdir"
+test_43j() {
+ [[ $MDS1_VERSION -lt $(version_code 2.13.52) ]] &&
+ skip "Need MDS version newer than 2.13.52"
+
+ for i in {1..100}; do
+#define OBD_FAIL_ONCE|OBD_FAIL_MDS_CREATE_RACE 0x167
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000167 2>/dev/null ||
+ true"
+ OK=0
+ mkdir $DIR1/$tdir &
+ PID1=$!
+ mkdir $DIR2/$tdir && ((OK++))
+ wait $PID1 && ((OK++))
+ (( OK == 1 )) || error "exactly one mkdir should succeed"
+
+ rmdir $DIR1/$tdir || error "rmdir failed"
+ done
+ return 0
+}
+run_test 43j "racy mkdir return EEXIST =============="
+
# test 44: rename tgt and blocking operations
test_44a() {
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mkdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; date;error "mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "mkdir must fail"
date
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "create must fail"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile-2
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
link $DIR2/$tfile-3 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "link must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
rm $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "unlink must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile-2
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile-3 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile-2
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-3 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000146 2>/dev/null || true"
mv $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
$LFS mkdir -i 1 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "remote mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "remote mkdir must fail"
}
run_test 44i "pdirops: rename tgt vs remote mkdir"
-# test 45: rename src and blocking operations
+# test 45: rename,mkdir doesn't fail with -EEXIST
test_45a() {
- pdo_lru_clear
- touch $DIR1/$tfile
-#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
- mv $DIR1/$tfile $DIR1/$tfile-2 &
- PID1=$! ; pdo_sched
- mkdir $DIR2/$tfile &
- PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
- check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
- wait $PID2 ; [ $? -eq 0 ] || error "mkdir must succeed"
- rm -rf $DIR/$tfile*
+ for i in {1..1000}; do
+ mkdir $DIR1/$tdir || error "mkdir $tdir failed"
+ mrename $DIR2/$tdir $DIR2/$tdir.$i > /dev/null ||
+ error "mrename to $tdir.$i failed"
+ done
+ rm -rf $DIR/$tdir*
return 0
}
-run_test 45a "pdirops: rename src vs mkdir =============="
+run_test 45a "rename,mkdir doesn't return -EEXIST =============="
test_45b() {
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "create must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
link $DIR2/$tfile-3 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "link must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
rm $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "unlink must fail"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
mv $DIR2/$tfile-3 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-3 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "rename must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "stat must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$! ; pdo_sched
$LFS mkdir -i 1 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "create remote dir isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "create remote dir must succeed"
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mkdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "mkdir must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
$MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "create must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
link $DIR2/$tfile $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "link must fail"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
rm $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "unlink must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile-2
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile-3 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
touch $DIR1/$tfile-2
touch $DIR1/$tfile-3
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-3 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
ls -lia $DIR2/ > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
wait $PID2
rm -rf $DIR/$tfile*
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
link $DIR1/$tfile-2 $DIR1/$tfile &
PID1=$! ; pdo_sched
$LFS mkdir -i 1 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "remote mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "remote mkdir must fail"
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
pdo_lru_clear
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
mkdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "mkdir must fail"
rm -rf $DIR/$tfile*
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
pdo_lru_clear
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
sleep 1 # please do not remove this sleep, see LU-10754
multiop $DIR2/$tfile oO_CREAT:O_EXCL:c &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "create isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "create must fail"
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
link $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "link must fail"
rm -rf $DIR/$tfile*
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
rmdir $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "unlink isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rmdir must succeed"
pdo_lru_clear
touch $DIR1/$tfile-2
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv -T $DIR2/$tfile-2 $DIR2/$tfile &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "rename isn't blocked"; }
wait $PID2 ; [ $? -ne 0 ] || error "rename must fail"
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
mv $DIR2/$tfile $DIR2/$tfile-2 &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "rename isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "rename must succeed"
sync_all_data
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
- do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
$LFS mkdir -i 1 $DIR1/$tfile &
PID1=$! ; pdo_sched
stat $DIR2/$tfile > /dev/null &
PID2=$! ; pdo_sched
- do_facet $SINGLEMDS lctl set_param fail_loc=0
+ do_nodes $(comma_list $(mdts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1;
error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
local tmpfile=`mktemp`
- # create an empty file
- $MCREATE $DIR1/$tfile || error "mcreate $DIR1/$tfile failed"
+ $LFS setstripe -E 1M -c 1 -E -1 --extension-size 64M $DIR1/$tfile ||
+ error "Create $DIR1/$tfile failed"
+
+ dd if=/dev/zero of=$DIR1/$tfile bs=1k count=1 conv=notrunc ||
+ error "dd $DIR1/$tfile failed"
# delay glimpse so that layout has changed when glimpse finish
#define OBD_FAIL_GLIMPSE_DELAY 0x1404
- $LCTL set_param fail_loc=0x1404
+ $LCTL set_param fail_loc=0x1404 fail_val=4
stat -c %s $DIR2/$tfile |tee $tmpfile &
local pid=$!
- sleep 1
+ sleep 0.2
- # create layout of testing file
- dd if=/dev/zero of=$DIR1/$tfile bs=1k count=1 conv=notrunc >/dev/null ||
+ # extend layout of testing file
+ dd if=/dev/zero of=$DIR1/$tfile bs=1M count=1 seek=2 conv=notrunc ||
error "dd $DIR1/$tfile failed"
wait $pid
local fsize=$(cat $tmpfile)
- [ x$fsize = x1024 ] || error "file size is $fsize, should be 1024"
+ [ x$fsize = x3145728 ] || error "file size is $fsize, should be 3145728"
rm -f $DIR1/$tfile $tmpfile
}
}
run_test 51d "layout lock: losing layout lock should clean up memory map region"
+test_51e() {
+ local pid
+
+ $MULTIOP $DIR/$tfile oO_CREAT:O_RDWR:eW_E+eUc &
+ pid=$!
+ sleep 1
+
+ $LFS getstripe $DIR2/$tfile
+ kill -USR1 $pid
+ wait $pid || error "multiop failed"
+
+ $MULTIOP $DIR/$tfile oO_RDONLY:eR_E+eUc &
+ pid=$!
+ sleep 1
+
+ $LFS getstripe $DIR2/$tfile
+ kill -USR1 $pid
+ wait $pid || error "multiop failed"
+}
+run_test 51e "lfs getstripe does not break leases, part 2"
+
test_54_part1()
{
echo "==> rename vs getattr vs setxattr should not deadlock"
}
run_test 81b "rename under striped directory doesn't deadlock"
+test_81c() {
+ [ $MDSCOUNT -lt 4 ] && skip_env "needs >= 4 MDTs"
+ [ $MDS1_VERSION -lt $(version_code 2.13.52) ] &&
+ skip "Need MDS version at least 2.13.52"
+
+ # source is local, source parent is remote
+ $LFS mkdir -i 0 $DIR1/${tdir}_src || error "mkdir ${tdir}_src"
+ $LFS mkdir -i 1 $DIR1/${tdir}_tgt || error "mkdir ${tdir}_tgt"
+ $LFS mkdir -i 3 $DIR1/${tdir}_src/sub || error "mkdir sub"
+ $LFS mkdir -i 3 $DIR1/${tdir}_tgt/sub || error "mkdir sub"
+ stat $DIR2/${tdir}_src/sub || error "stat sub failed"
+ mv $DIR1/${tdir}_src/sub $DIR1/${tdir}_tgt/ || error "mv failed"
+ [ -f $DIR2/${tdir}_src/sub ] && error "sub should be gone"
+ rm -rf $DIR1/${tdir}_src $DIR1/${tdir}_tgt
+
+ # source is remote, source parent is local
+ $LFS mkdir -i 3 $DIR1/${tdir}_src || error "mkdir ${tdir}_src"
+ $LFS mkdir -i 1 $DIR1/${tdir}_tgt || error "mkdir ${tdir}_tgt"
+ $LFS mkdir -i 0 $DIR1/${tdir}_src/sub || error "mkdir sub"
+ $LFS mkdir -i 3 $DIR1/${tdir}_tgt/sub || error "mkdir sub"
+ stat $DIR2/${tdir}_src/sub || error "stat sub failed"
+ mv $DIR1/${tdir}_src/sub $DIR1/${tdir}_tgt/ || error "mv failed"
+ [ -f $DIR2/${tdir}_src/sub ] && error "sub should be gone"
+ rm -rf $DIR1/${tdir}_src $DIR1/${tdir}_tgt
+
+ # source and source parent are remote
+ $LFS mkdir -i 0 $DIR1/${tdir}_src || error "mkdir ${tdir}_src"
+ $LFS mkdir -i 1 $DIR1/${tdir}_tgt || error "mkdir ${tdir}_tgt"
+ mkdir $DIR1/${tdir}_src/sub || error "mkdir sub"
+ $LFS mkdir -i 3 $DIR1/${tdir}_tgt/sub || error "mkdir sub"
+ stat $DIR2/${tdir}_src/sub || error "stat sub failed"
+ mv $DIR1/${tdir}_src/sub $DIR1/${tdir}_tgt/ || error "mv failed"
+ [ -f $DIR2/${tdir}_src/sub ] && error "sub should be gone"
+ rm -rf $DIR1/${tdir}_src $DIR1/${tdir}_tgt
+
+ # source and source parent are remote, and source is remote object
+ $LFS mkdir -i 0 $DIR1/${tdir}_src || error "mkdir ${tdir}_src"
+ $LFS mkdir -i 1 $DIR1/${tdir}_tgt || error "mkdir ${tdir}_tgt"
+ $LFS mkdir -i 2 $DIR1/${tdir}_src/sub || error "mkdir sub"
+ $LFS mkdir -i 3 $DIR1/${tdir}_tgt/sub || error "mkdir sub"
+ stat $DIR2/${tdir}_src/sub || error "stat sub failed"
+ mv $DIR1/${tdir}_src/sub $DIR1/${tdir}_tgt/ || error "mv failed"
+ [ -f $DIR2/${tdir}_src/sub ] && error "sub should be gone" || true
+}
+run_test 81c "rename revoke LOOKUP lock for remote object"
+
test_82() {
[[ "$MDS1_VERSION" -gt $(version_code 2.6.91) ]] ||
skip "Need MDS version at least 2.6.92"
[ $OST1_VERSION -lt $(version_code 2.10.50) ] &&
skip "Lockahead needs OST version at least 2.10.50"
- local testnum=23
+ local locktest=23
test_mkdir -p $DIR/$tdir
do_facet ost1 $LCTL set_param fail_loc=0x415 fail_val=2
echo "Incorrect size expected (no glimpse fix):"
- lockahead_test -d $DIR/$tdir -D $DIR2/$tdir -t $testnum -f $tfile
+ lockahead_test -d $DIR/$tdir -D $DIR2/$tdir -t $locktest -f $tfile
rc=$?
if [ $rc -eq 0 ]; then
echo "This doesn't work 100%, but this is just reproducing the bug, not testing the fix, so OK to not fail test."
do_facet ost1 $LCTL set_param fail_loc=0x214 fail_val=2
# Write commit is still delayed by 2 seconds
- lockahead_test -d $DIR/$tdir -D $DIR2/$tdir -t $testnum -f $tfile
+ lockahead_test -d $DIR/$tdir -D $DIR2/$tdir -t $locktest -f $tfile
rc=$?
- [ $rc -eq 0 ] || error "Lockahead test${testnum} failed, ${rc}"
+ [ $rc -eq 0 ] || error "Lockahead test$locktest failed, $rc"
# guarantee write commit timeout has expired
sleep 2
}
run_test 105 "Glimpse and lock cancel race"
+test_106a() {
+ [ "$mds1_FSTYPE" == "ldiskfs" ] && statx_supported ||
+ skip_env "Test only for ldiskfs and statx() supported"
+
+ local btime
+ local mdt_btime
+ local output
+ local mdtdev=$(mdsdevname ${SINGLEMDS//mds/})
+
+ dd if=/dev/zero of=$DIR/$tfile bs=1k count=1 conv=notrunc
+ btime=$($STATX -c %W $DIR/$tfile)
+ output=$(do_facet mds1 "$DEBUGFS -c -R 'stat ROOT/$tfile' $mdtdev")
+ echo $output
+ ((mdt_btime=$(awk -F ':' /crtime/'{ print $2 }' <<< "$output")))
+ [[ $btime == $mdt_btime ]] ||
+ error "$DIR/$tfile btime ($btime:$mdt_btime) diff"
+
+}
+run_test 106a "Verify the btime via statx()"
+
+test_106b() {
+ statx_supported || skip_env "statx() only test"
+
+ local rpcs_before
+ local rpcs_after
+
+ $LFS setstripe -c 1 $DIR/$tfile || error "$DIR/$tfile setstripe failed"
+ dd if=/dev/zero of=$DIR/$tfile bs=1k count=1 conv=notrunc
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ $STATX $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $((rpcs_before + 1)) ] ||
+ error "$STATX should send 1 glimpse RPC to $OSC"
+
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ # %n: FILENAME; %i: STATX_INO; %A STATX_MODE; %h STATX_NLINK;
+ # %u: STATX_UID; %g: STATX_GID; %W STATX_BTIME; %X STATX_ATIME;
+ # %Z: STATX_CTIME
+ $STATX -c "%n %i %A %h %u %g %W %X %Z" $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $rpcs_before ] ||
+ error "$STATX should not send glimpse RPCs to $OSC"
+
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ $STATX --cached=always $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $rpcs_before ] ||
+ error "$STATX should not send glimpse RPCs to $OSC"
+
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ $STATX -c %Y $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $((rpcs_before + 1)) ] ||
+ error "$STATX -c %Y should send 1 glimpse RPC to $OSC"
+
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ $STATX -c %s $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $((rpcs_before + 1)) ] ||
+ error "$STATX -c %s should send 1 glimpse RPC to $OSC"
+
+ cancel_lru_locks $OSC
+ rpcs_before=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ $STATX -c %b $DIR/$tfile
+ rpcs_after=$(calc_stats $OSC.*$OSC*.stats ldlm_glimpse_enqueue)
+ [ $rpcs_after -eq $((rpcs_before + 1)) ] ||
+ error "$STATX -c %b should send 1 glimpse RPC to $OSC"
+}
+run_test 106b "Glimpse RPCs test for statx"
+
+test_106c() {
+ statx_supported || skip_env "statx() only test"
+
+ local mask
+
+ touch $DIR/$tfile
+ # Mask supported in stx_attributes by Lustre is
+ # STATX_ATTR_IMMUTABLE(0x10) | STATX_ATTR_APPEND(0x20) : (0x30).
+ mask=$($STATX -c %p $DIR/$tfile)
+ [[ $mask == "30" ]] ||
+ error "supported stx_attributes: got '$mask', expected '30'"
+ chattr +i $DIR/$tfile || error "chattr +i $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "10" ]] ||
+ error "got immutable flags '$mask', expected '10'"
+ chattr -i $DIR/$tfile || error "chattr -i $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "0" ]] || error "got flags '$mask', expected '0'"
+ chattr +a $DIR/$tfile || error "chattr +a $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "20" ]] || error "got flags '$mask', expected '20'"
+ chattr -a $DIR/$tfile || error "chattr -a $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "0" ]] || error "got flags '$mask', expected '0'"
+ chattr +ia $DIR/$tfile || error "chattr +ia $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "30" ]] || error "got flags '$mask', expected '30'"
+ chattr -ia $DIR/$tfile || error "chattr -ia $DIR/$tfile failed"
+ mask=$($STATX -c %r $DIR/$tfile)
+ [[ $mask == "0" ]] || error "got flags '$mask', expected '0'"
+}
+run_test 106c "Verify statx attributes mask"
+
+test_107() { # LU-1031
+ dd if=/dev/zero of=$DIR1/$tfile bs=1M count=10
+ local gid1=14091995
+ local gid2=16022000
+
+ $LFS getstripe $DIR1/$tfile
+
+ multiop_bg_pause $DIR1/$tfile OG${gid1}_g${gid1}c || return 1
+ local MULTIPID1=$!
+ multiop_bg_pause $DIR2/$tfile O_G${gid2}r10g${gid2}c || return 2
+ local MULTIPID2=$!
+ kill -USR1 $MULTIPID2
+ sleep 2
+ if [[ `ps h -o comm -p $MULTIPID2` == "" ]]; then
+ error "First grouplock does not block second one"
+ else
+ echo "First grouplock blocks second one"
+ fi
+ kill -USR1 $MULTIPID1
+ wait $MULTIPID1
+ wait $MULTIPID2
+}
+run_test 107 "Basic grouplock conflict"
+
log "cleanup: ======================================================"
# kill and wait in each test only guarentee script finish, but command in script