Re: xfs_fsr (defragmenting) 'XFS_IOC_SWAPEXT failed: ino=xxxxxx: Invalid argument' error

Dave Chinner
2012-02-15T00:28:25Z

On Tue, Feb 14, 2012 at 06:46:28PM +0000, Tom Crane wrote:
> Dear XFS Support,
> I am attempting to use xfs_fsr to defrag a 60TB FS but am getting
> some of the following errors;
> 'XFS_IOC_SWAPEXT failed: ino=xxxxxx: Invalid argument'. Most files
> defrag w/o problem. In an hour long run only 45/(45+6211) failed
> this way. Here is a example chunk of syslog from a run with fsr -v
> which includes the FS level reports.
.....
> >Feb 14 15:49:15 store3 fsr[10917]: ino=797728
> >Feb 14 15:49:17 store3 kernel: Filesystem dm-0:
> >fs/xfs/xfs_dfrag.c: inode 0xc2c20 format is incompatible for exchanging.
> >Feb 14 15:49:17 store3 fsr[10917]: XFS_IOC_SWAPEXT failed: ino=797728: Invalid argument

Which means the kernel caught a condition where the extent swap
could not be done due to differences in the layout of the two
inodes. If we do the swap we corrupt the filesystem, so we abort
and return an error instead.

http://permalink.gmane.org/gmane.comp.file-systems.xfs.general/40013
http://www.spinics.net/lists/xfs/msg09736.html

> Is this a known problem with xfs in this kernel? Any other
> information/tests that I can supply?

No problems with the kernel. Deficiencies are on the userspace side
with how xfs_fsr is setting up the attribute fork on the donor
inode. The event tracing indicated in the second link above will
tell us what the incomaptibility is and maybe how to improve xfs_fsr
t0 avoid it...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com