All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs mailing list <xfs@oss.sgi.com>
Subject: [PATCH xfstests] _qmount: mount w/o selinux xattrs
Date: Thu, 01 Jul 2010 14:58:07 -0500	[thread overview]
Message-ID: <4C2CF34F.7070008@redhat.com> (raw)

when selinux is on it can change quota usage due to extra
xattr blocks.

Mounting with a context prevents this.  We already do so
for xfs in general because so many things look at detailed
on-disk format, and extra xattrs confuses those tests.

For other filesystems, we've left selinux alone so far, 
as that seemed the best way to test.

However, it throws quota accounting off, so add a fixup
in _qmount()

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common.quota b/common.quota
index d32e285..87a766c 100644
--- a/common.quota
+++ b/common.quota
@@ -131,8 +131,17 @@ _choose_prid()
 
 _qmount()
 {
+    # SELinux adds extra xattrs which can mess up our expected usage.
+    # So, mount with a context, and they won't be created
+    # nfs_t is a "liberal" context so we can use it.
+    # Only set it if we didn't inherit SELINUX_MOUNT_OPTIONS for
+    # all mounts anyway.
+    if [ -z "$SELINUX_MOUNT_OPTIONS" -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+        QUOTA_SELINUX_MOUNT_OPTIONS="-o context=system_u:object_r:nfs_t:s0"
+    fi
+
     umount $SCRATCH_DEV >/dev/null 2>&1
-    _scratch_mount || _fail "qmount failed"
+    _scratch_mount $QUOTA_SELINUX_MOUNT_OPTIONS || _fail "qmount failed"
     chmod ugo+rwx $SCRATCH_MNT
 }
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2010-07-01 19:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 19:58 Eric Sandeen [this message]
2010-07-02  7:10 ` [PATCH xfstests] _qmount: mount w/o selinux xattrs Christoph Hellwig
2010-07-02 17:48   ` Eric Sandeen
2010-07-09 16:12     ` Christoph Hellwig
2010-07-12 19:29       ` Eric Sandeen
2010-07-12 22:13         ` Dave Chinner
2010-07-13 16:40           ` Eric Sandeen

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=4C2CF34F.7070008@redhat.com \
    --to=sandeen@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.