test FIEMAP on extended attribute blocks
PATCH 1/1 test FIEMAP on extended attribute blocks
Make sure that FIEMAP produces some output when we add enough xattrs to force the xattrs to be stored in an external block.
Signed-off-by Darrick J. Wong <[email protected]>
--- common/rc | 15 +++++++- tests/generic/700 | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/700.out | 5 +++ tests/generic/group | 1 + 4 files changed, 112 insertions(+), 1 deletion(-) create mode 100755 tests/generic/700 create mode 100644 tests/generic/700.out
common/rc +14 -1
@@ -2037,7 +2037,7 @@ _require_xfs_io_command() ;; "fiemap") testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \ - -c "fiemap -v" $testfile 2>&1` + -c "fiemap -v $param" $testfile 2>&1` ;; "flink" ) testio=`$XFS_IO_PROG -T -F -c "flink $testfile" \
@@ -2070,6 +2070,8 @@ _require_xfs_io_command() _notrun "xfs_io $command support is missing" echo $testio | grep -q "Operation not supported" && \ _notrun "xfs_io $command failed (old kernel/wrong fs?)" + echo $testio | grep -q "Invalid" && \ + _notrun "xfs_io $command failed (old kernel/wrong fs/bad args?)" echo $testio | grep -q "foreign file active" && \ _notrun "xfs_io $command not supported on $FSTYP"
@@ -2915,6 +2917,17 @@ _count_holes() $XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep hole | wc -l } +# Does fiemap support reporting xattr extents? +_require_fiemap_attr() +{ + _require_xfs_io_command "fiemap" "-a" +} + +_count_attr_extents() +{ + $XFS_IO_PROG -c "fiemap -a" $1 | tail -n +2 | grep -v hole | wc -l +} + # arg 1 is dev to remove and is output of the below eg. # ls -l /sys/class/block/sdd | rev | cut -d "/" -f 3 | rev _devmgt_remove()
tests/generic/700 new file +92 -0
92 lines not on this page · raw message
tests/generic/700.out new file +5 -0
@@ -0,0 +1,5 @@ +QA output created by 700 +Format and mount +Create the original files +Check attr extent counts +Check attr extent counts after remount
tests/generic/group +1 -0
@@ -425,3 +425,4 @@ 420 auto quick punch 421 auto quick encrypt dangerous 422 auto quick +700 auto quick attr
Quoted 4 lines · Darrick J. Wong
Make sure that FIEMAP produces some output when we add enough xattrs to force the xattrs to be stored in an external block.
Signed-off-by Darrick J. Wong <[email protected]>
Thanks for resending! I've already queued it for the comming update.
Thanks,
Eryu