Re: [PATCH] fstests: generic/407: Use _reflink_range to avoid old xfs_io bug

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]





At 03/21/2017 04:20 PM, Eryu Guan wrote:
On Tue, Mar 21, 2017 at 03:53:21PM +0800, Qu Wenruo wrote:
Old xfs_io has a bug that even its man page shows that reflink can accept
one parameter, but in fact xfs_io reflink still needs full 4 parameters.

In this test case, it only needs to reflink the file and we know the
size of the file, so use _reflink_range() to replace open-coded reflink,
which makes the test case pass even its xfs_io is a little old and
doesn't accept single parameter.

IMO, you need to update your xfsprogs or fix the xfs_io bug (if it's not
fixed yet). I think there's nothing wrong with the test (unless the bug
won't be fixed in near future and blocks the test), it runs and finds a
bug for you :)

Yes I know it's a bug of my test environment.

But using _reflink_range won't cause anything wrong, and can make old xfsprogs (not too old, v4.9.0 from Fedora 25) happy.

Despite that, using _reflink_range to replace open-coded reflink is a quite valid cleanup for me.

Thanks,
Qu

Thanks,
Eryu


Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
---
 tests/generic/407 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/generic/407 b/tests/generic/407
index 1103d40..7d5a865 100755
--- a/tests/generic/407
+++ b/tests/generic/407
@@ -65,7 +65,7 @@ echo "before clone: $mtime1 $ctime1" >> $seqres.full

 # clone to trigger timestamp change
 sleep 1
-$XFS_IO_PROG -c "reflink $sourcefile " $destfile >> $seqres.full
+_reflink_range $sourcefile 0 $destfile 0 4k >> $seqres.full

 # sample and verify that timestamps have changed.
 mtime2=`stat -c %Y $destfile`
--
2.9.3



--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux