* migration to selinux + xfs_fsr oddity....
@ 2009-05-05 1:51 Eric Sandeen
2009-05-12 16:04 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-05-05 1:51 UTC (permalink / raw)
To: xfs-oss
This came up in RH Bugzilla #498860, "xfs_fsr fails to complete"
The reporter had an existing xfs filesystem from another Linux OS, and
was using it under Fedora now. He had some files for which xfs_fsr
bails out with EINVAL:
XFS_IOC_SWAPEXT failed: fragfile: Invalid argument
It's failing this check in xfs_swap_extents():
/*
* If the target has extended attributes, the tmp file
* must also in order to ensure the correct data fork
* format.
*/
if ( XFS_IFORK_Q(ip) != XFS_IFORK_Q(tip) ) {
error = XFS_ERROR(EINVAL);
goto error0;
}
because the original filesystem had no selinux xattrs, but the new/temp
file created during xfs_fsr got the selinux xattr, so failed this test.
It can be demonstrated like this on a machine w/ selinux:
# mkfs.xfs -dfile,name=fsfile,size=32m
# mkdir test
# mount -o loop,context="unconfined_u:object_r:user_tmp_t:s0" fsfile test
# for I in `seq 10 -1 0`; do dd if=/dev/zero of=test/fragfile bs=4k count=1
seek=$I conv=notrunc oflag=sync; done
# umount test
# mount -o loop fsfile test
# xfs_fsr test/fragfile
XFS_IOC_SWAPEXT failed: fragfile: Invalid argument
I'm not sure if this is the sort of thing to maybe just caveat &
document, or try to work around ... somehow? Maybe detect this case a
bit better and print something more helpful about what has gone wrong?
(As an aside ... looking at the above test and others related, and
thinking about a few random reports that xfs_fsr corrupted a file, I
can't help but think that maybe we are winding up with incompatible
formats for the original and donor inodes in some cases...)
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: migration to selinux + xfs_fsr oddity....
2009-05-05 1:51 migration to selinux + xfs_fsr oddity Eric Sandeen
@ 2009-05-12 16:04 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2009-05-12 16:04 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Mon, May 04, 2009 at 08:51:10PM -0500, Eric Sandeen wrote:
> This came up in RH Bugzilla #498860, "xfs_fsr fails to complete"
>
> The reporter had an existing xfs filesystem from another Linux OS, and
> was using it under Fedora now. He had some files for which xfs_fsr
> bails out with EINVAL:
>
> XFS_IOC_SWAPEXT failed: fragfile: Invalid argument
As analyzed in the bugzilla this is a problem when selinux attributes
are created underneath due to selinux.
Either we relax the attribute fork check an allow the new inode to have
an attribute fork despite the old one not having one, or we need to
create a fake xattr on the file to be defragmented.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-12 16:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 1:51 migration to selinux + xfs_fsr oddity Eric Sandeen
2009-05-12 16:04 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox