xfs
[Top] [All Lists]

Re: [PATCH 7/9] xfstests: add a new quota test that runs fsstress under

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 7/9] xfstests: add a new quota test that runs fsstress under ENOSPC conditions
From: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
Date: Mon, 07 Nov 2011 10:15:33 +0400
Cc: linux-fsdevel@xxxxxxxxxxxxxxx, aelder@xxxxxxx, tytso@xxxxxxx, hch@xxxxxx, xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=bbmL/bN1670S1XOtb+Eow8pz1LHkBvemI5BDpnZWjnE=; b=dkv/FT6I0uBzxzgMb+HM1Hi0BfVTN2Rykf0FqsON45eCo6Ht/dYewI2HWb/7F/GOed J6hZnvWZHYmH06zlegKuqfkDbtGqTWGOutml9cvlv5ie5PszeaT4gc4yrjvqnGLKM7Eu jhnPZBKjs5wd1PwJLBozh3OjSCIfkXZXqCObw=
In-reply-to: <20111103193935.GA23014@xxxxxxxxxxxxx>
References: <1320342953-7973-1-git-send-email-dmonakhov@xxxxxxxxxx> <1320342953-7973-7-git-send-email-dmonakhov@xxxxxxxxxx> <20111103193935.GA23014@xxxxxxxxxxxxx>
Sender: Dmitry Monakhov <rjevskiy@xxxxxxxxx>
User-agent: Notmuch/0.5-69-g3e4a9d6 (http://notmuchmail.org) Emacs/23.1.1 (i486-pc-linux-gnu)
On Thu, 3 Nov 2011 15:39:35 -0400, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> On Thu, Nov 03, 2011 at 09:55:51PM +0400, Dmitry Monakhov wrote:
> > - Same as 264 but with quota enabled.
> 
> 269 is the new 270
> 
> > - IO performed from $qa_user user
> > - fsstress granted with CAP_CHOWN capability.
> 
> This fails in my test VM because it doesn't have setcap.  If you
> want to use additional non-standard tools please do a _notrun if
> they aren't present.
> 
> I don't quite understand why it would need CAP_CHOWN - chowns
> from owned files do not require it, and the test runs fine with
> the setcap line commented out.
Yes, but fsstress want chown to random uid/gid 
int inode_change_ok(..)
...
        /* Make sure a caller can chown. */
        if ((ia_valid & ATTR_UID) &&
            (current_fsuid() != inode->i_uid ||
             attr->ia_uid != inode->i_uid) && !capable(CAP_CHOWN))
                return -EPERM;
>From my experience fssstess with chown enabled is the most valuable
quota accounting test. W/o chown this is just an useless time consumer.
> 
> I'll commit it as-is for now, but unless I get some feedback on
> why the setcap is require I'll add another commit to remove it ASAP.

>From f8611f3bbc5ea2ac3672ee6c88d2d43d69351d49 Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
Date: Mon, 7 Nov 2011 08:07:57 +0300
Subject: [PATCH] xfstests: 270'th test want use setcap(8)

It wants to grant CAP_CHOWN to fsstress, without this capability
chown(2) will fail due to EPERM. Since chown(2) is one of the most
error prone places of quota accounting this makes 270'th
test almost useless, so it is better to simply skip it.

Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
 270 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/270 b/270
index ed1e31e..90e24f5 100755
--- a/270
+++ b/270
@@ -52,6 +52,9 @@ _workout()
        echo "fsstress $args" >> $here/$seq.full
        # Grant chown capability 
        cp $FSSTRESS_PROG  $tmp.fsstress.bin
+       if [ "`whereis setcap`" == "setcap:" ]; then
+            _notrun "setcap not installed."
+       fi
        setcap cap_chown=epi  $tmp.fsstress.bin
 
        (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
-- 
1.7.1

> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
<Prev in Thread] Current Thread [Next in Thread>