linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Subject: [PATCH 1/2] nfs4lib: update do_getattr to use root_fh if no fh provided
Date: Tue, 10 Jan 2017 13:02:28 +0100	[thread overview]
Message-ID: <20170110120229.23413-1-tigran.mkrtchyan@desy.de> (raw)

do_getattr(FATTR4_XX) is now equal to do_getattr(FATTR4_XX, root_fh)
The use_obj is updated to return putrootfh operation if file object
is not provided.

This looks like safe change as do_getattr(attr, None) was broken
(c.homedir variable never exist), thus was never used.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 nfs4.0/nfs4lib.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/nfs4.0/nfs4lib.py b/nfs4.0/nfs4lib.py
index 5031feb..8bda72a 100644
--- a/nfs4.0/nfs4lib.py
+++ b/nfs4.0/nfs4lib.py
@@ -489,7 +489,7 @@ class NFS4Client(rpc.RPCClient, nfs4_ops.NFS4Operations):
     def use_obj(self, file):
         """File is either None, a fh, or a list of path components"""
         if file is None or file == [None]:
-            return []
+            return [self.putrootfh_op()]
         elif type(file) is str:
             return [self.putfh_op(file)]
         else:
@@ -505,7 +505,6 @@ class NFS4Client(rpc.RPCClient, nfs4_ops.NFS4Operations):
 
 
     def do_getattr(self, attr, file=None):
-        if file is None: file = c.homedir
         d = self.do_getattrdict(file, [attr])
         if attr in d:
             return d[attr]
-- 
2.9.3


             reply	other threads:[~2017-01-10 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 12:02 Tigran Mkrtchyan [this message]
2017-01-10 12:02 ` [PATCH 2/2] st_write: test server behavior on WRITE with offset+len > maxfilesize Tigran Mkrtchyan
2017-01-11 14:27   ` Mkrtchyan, Tigran

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=20170110120229.23413-1-tigran.mkrtchyan@desy.de \
    --to=tigran.mkrtchyan@desy.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).