The final version of the EXCHANGERANGE ioctl has dropped the flag that
enforced that the two files being operated upon were exactly the same
length as was specified in the ioctl parameters. Remove this check
since it's now defunct.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
echo file2 unaligned EOF to file1 nowhere near EOF
$XFS_IO_PROG -c "exchangerange -s 0 -d $(( blksz * nrblks )) -l 37 $dir/b" $dir/a
-echo Files of unequal length
-_pwrite_byte 0x58 $((blksz * nrblks)) $((blksz * 2)) $dir/a >> $seqres.full
-_pwrite_byte 0x59 $((blksz * nrblks)) $blksz $dir/b >> $seqres.full
-$XFS_IO_PROG -c "exchangerange $dir/b" $dir/a
-
echo Files on different filesystems
_pwrite_byte 0x58 0 $((blksz * nrblks)) $SCRATCH_MNT/c >> $seqres.full
$XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/c" $dir/a
exchangerange: Invalid argument
file2 unaligned EOF to file1 nowhere near EOF
exchangerange: Invalid argument
-Files of unequal length
-exchangerange: Bad address
Files on different filesystems
exchangerange: Invalid cross-device link
Files on different mounts