public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: migration to selinux + xfs_fsr oddity....
Date: Mon, 04 May 2009 20:51:10 -0500	[thread overview]
Message-ID: <49FF9B8E.7040607@sandeen.net> (raw)

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

             reply	other threads:[~2009-05-05  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05  1:51 Eric Sandeen [this message]
2009-05-12 16:04 ` migration to selinux + xfs_fsr oddity Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49FF9B8E.7040607@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox