lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140722210533.GK20518@dastard>
Date:	Wed, 23 Jul 2014 07:05:33 +1000
From:	Dave Chinner <david@...morbit.com>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	fstests@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 1/2] xfstests: add data integtiry test for e4defrag
 ext4/307

On Wed, Jul 23, 2014 at 12:37:34AM +0400, Dmitry Monakhov wrote:
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>

Needs a proper commit message.

Also, what makes this ext4 specific? Why can't it run on any
filesystem with a defrag operation?

> +_need_to_be_root
> +_require_scratch
> +_require_defrag
> +
> +rm -f $seqres.full
> +
> +_workout()
> +{
> +    	nr=$1
> +	echo "Defragment file with $nr * 2 fragments"
> +	# Create sparse file
> +    	for ((i=0;i<nr;i++))
> +	do
> +	    fallocate -l 4k -o $((409600*i)) $SCRATCH_MNT/test.$nr
> +	done

please use $XFS_IO_PROG -c "falloc" ... for these operations to minimise
the number of external dependencies...


> +	# Fill holes for half of range , as result file will contain nr*1.5 fragments
> +	fallocate -l $((204800*nr)) $SCRATCH_MNT/test.$nr
> +	# Data wrilte will convert extetns to inialized ones
> +    	for ((i=0;i<nr;i++))

whitespace

> +	do
> +	    dd if=/dev/urandom bs=1234 seek=$((100*i)) of=$SCRATCH_MNT/test.$nr \
> +		conv=notrunc count=3 >> $seqres.full 2>&1
> +	done

again, $XFS_IO_PROG -c "pwrite .." rather than dd. And use a fixed
pattern, so that the hash of the file is predictable.


> +	filefrag -v $SCRATCH_MNT/test.$nr >> $seqres.full

$XFS_IO_PROG -c "fiemap" ....

> +	sha1sum $SCRATCH_MNT/test.$nr > $SCRATCH_MNT/test.$nr.sha1sum

md5sum is sufficient and faster for this sort of testing, and used
everywhere else in xfstests for this purpose. And with predictable
file contents, the output can be dumped into the output file like:

	md5sum $SCRATCH_MNT/test.$nr | _filter_scratch

And so we get file contents integrity checking from both the initial
write and the defrag command...

> +	$DEFRAG_PROG $SCRATCH_MNT $SCRATCH_DEV >> $seqres.full 2>&1
> +	filefrag -v $SCRATCH_MNT/test.$nr >> $seqres.full
> +	run_check sha1sum -c $SCRATCH_MNT/test.$nr.sha1sum

And this run_check can go away - just dump the md5sum again.

-Dave.
-- 
Dave Chinner
david@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ