[PATCH 3/3] 289: Test that filesystem sends discard requests only on free sectors

Rich Johnston rjohnston at sgi.com
Tue Oct 30 15:18:03 CDT 2012


On 10/18/2012 03:45 AM, Tomas Racek wrote:
> This is done by comparing free sectors reported by some FS utility
> (dumpe2fs/xfs_db) and actual discard commands sent to device obtained
> via blk tracer in debugfs.
>
> Currently supported FS are ext[34], xfs; device with discard support is
> not required, the test creates loop device for this purpose.
>
> Signed-off-by: Tomas Racek <tracek at redhat.com>
> ---
>   289     | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   289.out |   5 ++
>   group   |   1 +
>   3 files changed, 175 insertions(+)
>   create mode 100755 289
>   create mode 100644 289.out
>


This will not work for 3.x kernels, but they 2.6 and 3.x both use the 
same path.

> +debugfs=$($MOUNT_PROG | grep debugfs | cut -d " " -f3)
> +[ -n $debugfs ] || _notrun "This test requires mounted debugfs"

As you use $debugfs quite a bit from here on, suggest doing something like:

debugfs=/sys/kernel/debug
if [ ! -d $debugfs ]; then
    _notrun "This test requires mounted debugfs"
fi

Other than that it looks great.




More information about the xfs mailing list