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
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 ================================="
test_20() {
test_mkdir $DIR1/d20
- cancel_lru_locks $OSC
+ cancel_lru_locks
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
+ cancel_lru_locks
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
[ "$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
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
local pid=$!
sleep 1
- # 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"
}
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"
+
log "cleanup: ======================================================"
# kill and wait in each test only guarentee script finish, but command in script