xfs
[Top] [All Lists]

Re: xfstests 258: Test xfs fs creation with fs size close to 4 TB

To: Boris Ranto <branto@xxxxxxxxxx>
Subject: Re: xfstests 258: Test xfs fs creation with fs size close to 4 TB
From: Alex Elder <aelder@xxxxxxx>
Date: Wed, 21 Sep 2011 11:54:35 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxx>
In-reply-to: <1316613160.781.8.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <1316613160.781.8.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
On Wed, 2011-09-21 at 15:52 +0200, Boris Ranto wrote:
> mkfs.xfs failed to create xfs filesystems with 4 TB minus few bytes due
> to round up error in mkfs.xfs code.
> 
> This test case is a regression test for the fs creation problem.
> 
> I've tested the test case with mkfs.xfs patch (in the form posted by
> Eric Sandeen) and the test passed (and therefore the patch fixed the
> issue for me).
> 
> Signed-off-by: Boris Ranto <branto@xxxxxxxxxx>

This looks OK, but I'm a little concerned about the
shell's ability to handle > 32-bit values in its
arithmetic expressions (within $((...))).

Using ${fourtb} works for me, but I just don't know
whether it is written somewhere that bash always
supports 64-bit (or even arbitrary) precision values.

Do you know?

Same general concern goes for dd, but I am more inclined
to think it can handle large numbers.

Otherwise this looks good to me (though I haven't yet
tried it out).

Reviewed-by: Alex Elder <aelder@xxxxxxx>

. . .

> +fourtb=4398046511104
> +for sub in 1 512 1024 1025 2048 4096;
> +do
> +     echo "Trying to make $fourtb - $sub B long xfs fs image"
> +     rm -f "$testfile"
> +     dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$(($fourtb - $sub))
> >/dev/null 2>&1 || echo "dd failed"
> +     lofile=$(losetup -f)
> +     losetup $lofile "$testfile"
> +     "$MKFS_XFS_PROG" -b size=512 $lofile >/dev/null || echo "mkfs failed!"
> +     losetup -d $lofile
> +done
> +

. . .


<Prev in Thread] Current Thread [Next in Thread>