* [PATCH] xfstests 016: Do not discard blocks at the mkfs time
@ 2011-10-26 10:46 Boris Ranto
2011-10-27 16:04 ` Christoph Hellwig
2011-10-28 9:38 ` [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version Boris Ranto
0 siblings, 2 replies; 7+ messages in thread
From: Boris Ranto @ 2011-10-26 10:46 UTC (permalink / raw)
To: xfs, Eric Sandeen
The test 016 fills scratch device with some data and then creates xfs fs
on the scratch device. Later, the test assumes that the previously
written data are still in there and checks for them at specific
locations. On ssd drive this will lead to failure since the blocks are
discarded by default when the mkfs command is run.
This simple patch that adds -K to stop the discarding (if the mkfs
command supports it) fixed the issue for me:
Signed-off-by: Boris Ranto <branto@redhat.com>
diff --git a/016 b/016
index 9275ade..db76398 100755
--- a/016
+++ b/016
@@ -65,6 +65,8 @@ _init()
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
force_opts="-dsize=50m -lsize=$log_size"
+ # Do not discard blocks, we need them for further reads
+ _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1 &&
force_opts="-K $force_opts"
echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
_scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
[ $? -ne 0 ] && \
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests 016: Do not discard blocks at the mkfs time
2011-10-26 10:46 [PATCH] xfstests 016: Do not discard blocks at the mkfs time Boris Ranto
@ 2011-10-27 16:04 ` Christoph Hellwig
2011-10-28 9:25 ` Boris Ranto
2011-10-28 9:38 ` [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version Boris Ranto
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2011-10-27 16:04 UTC (permalink / raw)
To: Boris Ranto; +Cc: Eric Sandeen, xfs
On Wed, Oct 26, 2011 at 12:46:23PM +0200, Boris Ranto wrote:
> The test 016 fills scratch device with some data and then creates xfs fs
> on the scratch device. Later, the test assumes that the previously
> written data are still in there and checks for them at specific
> locations. On ssd drive this will lead to failure since the blocks are
> discarded by default when the mkfs command is run.
> This simple patch that adds -K to stop the discarding (if the mkfs
> command supports it) fixed the issue for me:
>
> Signed-off-by: Boris Ranto <branto@redhat.com>
>
> diff --git a/016 b/016
> index 9275ade..db76398 100755
> --- a/016
> +++ b/016
> @@ -65,6 +65,8 @@ _init()
> $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
> echo "*** mkfs"
> force_opts="-dsize=50m -lsize=$log_size"
> + # Do not discard blocks, we need them for further reads
> + _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1 &&
> force_opts="-K $force_opts"
> echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
> _scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
It took me very long understanding why you do mkfs.xfs calls here,
but I suspect now that it is to detect if -K is supported?
If so please document it in a comment, and maybe also write the
code a bit more verbose, e.g.
#
# Do not discard blocks as we check for patterns in freespace.
#
# Given that older xfsprogs versions do not have the -K option
# make sure it works first.
#
if _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1; then
force_opts="-K $force_opts"
fi
Otherwise the test looks good and will fix the 016 failure on TP / TRIM
capable devices that I've been seeing for a while.
Thanks a lot for doing this!
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests 016: Do not discard blocks at the mkfs time
2011-10-27 16:04 ` Christoph Hellwig
@ 2011-10-28 9:25 ` Boris Ranto
0 siblings, 0 replies; 7+ messages in thread
From: Boris Ranto @ 2011-10-28 9:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Eric Sandeen, xfs
On Thu, Oct 27, 2011, Christoph Hellwig wrote:
> On Wed, Oct 26, 2011 at 12:46:23PM +0200, Boris Ranto wrote:
> > The test 016 fills scratch device with some data and then creates
> > xfs fs
> > on the scratch device. Later, the test assumes that the previously
> > written data are still in there and checks for them at specific
> > locations. On ssd drive this will lead to failure since the blocks
> > are
> > discarded by default when the mkfs command is run.
> > This simple patch that adds -K to stop the discarding (if the mkfs
> > command supports it) fixed the issue for me:
> >
> > Signed-off-by: Boris Ranto <branto@redhat.com>
> >
> > diff --git a/016 b/016
> > index 9275ade..db76398 100755
> > --- a/016
> > +++ b/016
> > @@ -65,6 +65,8 @@ _init()
> > $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
> > echo "*** mkfs"
> > force_opts="-dsize=50m -lsize=$log_size"
> > + # Do not discard blocks, we need them for further reads
> > + _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1 &&
> > force_opts="-K $force_opts"
> > echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
> > _scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
>
> It took me very long understanding why you do mkfs.xfs calls here,
> but I suspect now that it is to detect if -K is supported?
>
> If so please document it in a comment, and maybe also write the
> code a bit more verbose, e.g.
>
> #
> # Do not discard blocks as we check for patterns in freespace.
> #
> # Given that older xfsprogs versions do not have the -K option
> # make sure it works first.
> #
> if _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1; then
> force_opts="-K $force_opts"
> fi
>
> Otherwise the test looks good and will fix the 016 failure on TP /
> TRIM
> capable devices that I've been seeing for a while.
>
> Thanks a lot for doing this!
>
Yes, the dry mkfs.xfs call is there just to check whether mkfs supports the '-K' option.
I'll resend the patch in its more verbose form to make it more clear.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version
2011-10-26 10:46 [PATCH] xfstests 016: Do not discard blocks at the mkfs time Boris Ranto
2011-10-27 16:04 ` Christoph Hellwig
@ 2011-10-28 9:38 ` Boris Ranto
2011-10-28 9:53 ` Christoph Hellwig
1 sibling, 1 reply; 7+ messages in thread
From: Boris Ranto @ 2011-10-28 9:38 UTC (permalink / raw)
To: xfs; +Cc: Christoph Hellwig, Eric Sandeen
The test 016 fills scratch device with some data and then creates xfs fs
on the scratch device. Later, the test assumes that the previously
written data are still written there and checks for them at specific
locations. On ssd drive this will lead to a failure since the blocks are
discarded by default when the mkfs command is run.
This is a more verbose version of the previous patch.
This simple patch that adds -K to stop the discarding (if the mkfs
command supports it) fixed the issue for me:
Signed-off-by: Boris Ranto <branto@redhat.com>
diff --git a/016 b/016
index 9275ade..08a73f4 100755
--- a/016
+++ b/016
@@ -65,6 +65,15 @@ _init()
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
force_opts="-dsize=50m -lsize=$log_size"
+ #
+ # Do not discard blocks as we check for patterns in free space.
+ #
+ # First, make sure that mkfs supports '-K' option by using its
+ # dry run (-N option) and then add it to the force_opts.
+ #
+ if _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1; then
+ force_opts="-K $force_opts"
+ fi
echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
_scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
[ $? -ne 0 ] && \
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version
2011-10-28 9:38 ` [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version Boris Ranto
@ 2011-10-28 9:53 ` Christoph Hellwig
2012-05-29 16:54 ` Eric Sandeen
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2011-10-28 9:53 UTC (permalink / raw)
To: Boris Ranto; +Cc: Christoph Hellwig, Eric Sandeen, xfs
On Fri, Oct 28, 2011 at 05:38:06AM -0400, Boris Ranto wrote:
> The test 016 fills scratch device with some data and then creates xfs fs
> on the scratch device. Later, the test assumes that the previously
> written data are still written there and checks for them at specific
> locations. On ssd drive this will lead to a failure since the blocks are
> discarded by default when the mkfs command is run.
> This is a more verbose version of the previous patch.
> This simple patch that adds -K to stop the discarding (if the mkfs
> command supports it) fixed the issue for me:
>
> Signed-off-by: Boris Ranto <branto@redhat.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version
2011-10-28 9:53 ` Christoph Hellwig
@ 2012-05-29 16:54 ` Eric Sandeen
2012-05-30 7:42 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2012-05-29 16:54 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Boris Ranto, xfs
On 10/28/11 4:53 AM, Christoph Hellwig wrote:
> On Fri, Oct 28, 2011 at 05:38:06AM -0400, Boris Ranto wrote:
>> The test 016 fills scratch device with some data and then creates xfs fs
>> on the scratch device. Later, the test assumes that the previously
>> written data are still written there and checks for them at specific
>> locations. On ssd drive this will lead to a failure since the blocks are
>> discarded by default when the mkfs command is run.
>> This is a more verbose version of the previous patch.
>> This simple patch that adds -K to stop the discarding (if the mkfs
>> command supports it) fixed the issue for me:
>>
>> Signed-off-by: Boris Ranto <branto@redhat.com>
>
> Looks good,
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Seems this one got lost; we should still merge it, yes?
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version
2012-05-29 16:54 ` Eric Sandeen
@ 2012-05-30 7:42 ` Christoph Hellwig
0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2012-05-30 7:42 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, Boris Ranto, xfs
On Tue, May 29, 2012 at 11:54:31AM -0500, Eric Sandeen wrote:
> Seems this one got lost; we should still merge it, yes?
Please do.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-30 7:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26 10:46 [PATCH] xfstests 016: Do not discard blocks at the mkfs time Boris Ranto
2011-10-27 16:04 ` Christoph Hellwig
2011-10-28 9:25 ` Boris Ranto
2011-10-28 9:38 ` [PATCH] xfstests 016: Do not discard blocks at the mkfs time, more verbose version Boris Ranto
2011-10-28 9:53 ` Christoph Hellwig
2012-05-29 16:54 ` Eric Sandeen
2012-05-30 7:42 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox