fsstress: avoid infinite loops in clonerange_f
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 23 Feb 2018 16:22:24 +0000 (08:22 -0800)
committerEryu Guan <eguan@redhat.com>
Sat, 24 Feb 2018 04:04:55 +0000 (12:04 +0800)
commit5e6514523342b51c18b059b61b51c1f619754fd0
tree936d4d95366205aa4c5584c85a6071654df26cfc
parent715eac1a9e665e9fe4910d19dbca172cb7f2d459
fsstress: avoid infinite loops in clonerange_f

Evidently ceph will report a 4M blocksize, which trips clonerange_f's
clumsy attempt to avoid reflinking an extent on top of itself.  The
original code assumed that "pick a random destination up to 1MB past the
end of the file" would suffice, but that clearly won't with a 4M
blocksize.  Instead, we'll change it to 1024*blksize.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsstress.c