[PATCH 1/2] nfs4lib: update do_getattr to use root_fh if no fh provided

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux