All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	kinglongmee@gmail.com
Subject: Re: [PATCH 3/3 v3] ACL: Add some test cases for nfsv4 acl
Date: Thu, 26 Jun 2014 08:05:39 +0800	[thread overview]
Message-ID: <53AB63D3.90509@gmail.com> (raw)
In-Reply-To: <20140618145626.GC17790@fieldses.org>

On 6/18/2014 22:56, J. Bruce Fields wrote:
> On Fri, Jun 13, 2014 at 06:52:13PM +0800, Kinglong Mee wrote:
>> v3, modify for exist st_acl.py
>>
>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>> ---
>>  nfs4.0/servertests/st_acl.py | 337 +++++++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 326 insertions(+), 11 deletions(-)
... snip ...
>> +def doSetACLEnv(t, env, type = NF4REG):
>> +    c = env.c1
>> +    path = c.homedir + [t.code]
>> +    res = c.create_obj(path, attrs={FATTR4_MODE:0777})
>> +    check(res)
>> +
>> +    c1 = env.c2
> 
> That's pretty confusing variable naming.

A new patch fixing the variable is added below.
Please have a check, thanks.

> 
>> +    c1.init_connection()
>> +
>> +    path += [t.code]
>> +    attrs = {FATTR4_MODE: 0777}
>> +
>> +    if type == NF4REG:
>> +        fh, stateid = c1.create_confirm(t.code, path, attrs=attrs,
>> +                                        deny=OPEN4_SHARE_DENY_NONE)
> 
> Also, this creates a minor cleanup annoyance: a later run of pynfs will
> attempt to reuse the already-existing tree and if it's not running as
> root tries to make everything writable (see nfs4.0/nfs4lib.py:clean_dir)
> so pynfs gives up when a setattr of mode fails (because this file is
> owned by someone else).

Yes, that's right.
I will check the problem with running as a non-root user,
and try to find the resolve.

> 
> Honestly I don't really understand how pynfs is meant to work here or
> who's fault this is, but I'm setting this patch aside for now.
> 

As you said, I always run it as a root-user, so pynfs works correctly.

thanks,
Kinglong Mee

>From b340bb95ab063d19f421fb987114ef05c395ee64 Mon Sep 17 00:00:00 2001
From: Kinglong Mee <kinglongmee@gmail.com>
Date: Thu, 26 Jun 2014 15:57:11 +0800
Subject: [PATCH] nfs4.0/acl: meaningful variable naming for session

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 nfs4.0/servertests/st_acl.py | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/nfs4.0/servertests/st_acl.py b/nfs4.0/servertests/st_acl.py
index 5c7146a..7869189 100644
--- a/nfs4.0/servertests/st_acl.py
+++ b/nfs4.0/servertests/st_acl.py
@@ -130,25 +130,28 @@ def doCheckACL(t, c, file, acl):
 #    print printableacl(attrs[FATTR4_ACL])
 
 def doSetACLEnv(t, env, type = NF4REG):
-    c = env.c1
-    path = c.homedir + [t.code]
-    res = c.create_obj(path, attrs={FATTR4_MODE:0777})
+    """ Create a directory with 0777 as top dir, and create a directory
+        or a regualr file for testing by other user under the above dir.
+    """
+    cdir = env.c1
+    path = cdir.homedir + [t.code]
+    res = cdir.create_obj(path, attrs={FATTR4_MODE:0777})
     check(res)
 
-    c1 = env.c2
-    c1.init_connection()
+    ctest = env.c2
+    ctest.init_connection()
 
     path += [t.code]
     attrs = {FATTR4_MODE: 0777}
 
     if type == NF4REG:
-        fh, stateid = c1.create_confirm(t.code, path, attrs=attrs,
+        fh, stateid = ctest.create_confirm(t.code, path, attrs=attrs,
                                         deny=OPEN4_SHARE_DENY_NONE)
-        return (c1, path, fh, stateid)
+        return (ctest, path, fh, stateid)
     else:
-        res = c1.create_obj(path, attrs=attrs)
+        res = ctest.create_obj(path, attrs=attrs)
         check(res)
-        return (c1, path)
+        return (ctest, path)
 
 def testWriteFileWithoutACL(t, env):
     """ Check write file without write ACL
-- 
1.9.3


      reply	other threads:[~2014-06-26  0:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 10:52 [PATCH 3/3 v3] ACL: Add some test cases for nfsv4 acl Kinglong Mee
2014-06-18 14:56 ` J. Bruce Fields
2014-06-26  0:05   ` Kinglong Mee [this message]

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=53AB63D3.90509@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /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.