[PATCH] xfstests: check block truncation after write failure

Dave Chinner david at fromorbit.com
Tue Nov 9 16:34:26 CST 2010


On Tue, Nov 09, 2010 at 06:49:23AM -0500, Christoph Hellwig wrote:
> Extraced from  https://bugzilla.kernel.org/show_bug.cgi?id=22452
> "data corruption after mmap()ing a file and writev() some data to another file"
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>

Looks good. One comment below....

Reviewed-by: Dave Chinner <david at fromorbit.com>

> +{
> +	rm -rf $file
> +	rm -rf $file.NEW
> +}
> +
> +trap "_cleanup ; exit \$status" 0 1 2 3 15
> +
> +echo -n "cccccccccc" > $file
> +$here/src/t_mmap_writev $file $file.NEW
> +xxd $file.NEW

xxd - on debian that's packaged in the vim-common package, which
not everyone will have installed (e.g. emacs users ;).

Better to use 'od -Ax' as od is part of coreutils and already used
in other qa tests so we don't introduce a new external dependency...

CHeers,

Dave.
-- 
Dave Chinner
david at fromorbit.com




More information about the xfs mailing list