aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-08-10 17:45:11 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:18:38 -0400
commit76b32999dfff6e59252a8af17a5671a4cf3bcf9b (patch)
tree6494e3a368e120668052e469c08c69a5d8d0b3f4 /fs/nfs/nfs4proc.c
parentaf22f94ae02ab9dd4fd7fe628c8434a59cc293be (diff)
NFSv4: Make NFSv4 ACCESS calls return attributes too...
It doesn't really make sense to cache an access call without also revalidating the attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5aa0dd1e1bdf..0e366a31f63b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -62,7 +62,6 @@ struct nfs4_opendata;
62static int _nfs4_proc_open(struct nfs4_opendata *data); 62static int _nfs4_proc_open(struct nfs4_opendata *data);
63static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); 63static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
64static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *); 64static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *);
65static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry);
66static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception); 65static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception);
67static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp); 66static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp);
68static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr); 67static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr);
@@ -1726,10 +1725,16 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh
1726 1725
1727static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) 1726static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
1728{ 1727{
1728 struct nfs_server *server = NFS_SERVER(inode);
1729 struct nfs_fattr fattr;
1729 struct nfs4_accessargs args = { 1730 struct nfs4_accessargs args = {
1730 .fh = NFS_FH(inode), 1731 .fh = NFS_FH(inode),
1732 .bitmask = server->attr_bitmask,
1733 };
1734 struct nfs4_accessres res = {
1735 .server = server,
1736 .fattr = &fattr,
1731 }; 1737 };
1732 struct nfs4_accessres res = { 0 };
1733 struct rpc_message msg = { 1738 struct rpc_message msg = {
1734 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS], 1739 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS],
1735 .rpc_argp = &args, 1740 .rpc_argp = &args,
@@ -1755,6 +1760,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
1755 if (mode & MAY_EXEC) 1760 if (mode & MAY_EXEC)
1756 args.access |= NFS4_ACCESS_EXECUTE; 1761 args.access |= NFS4_ACCESS_EXECUTE;
1757 } 1762 }
1763 nfs_fattr_init(&fattr);
1758 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 1764 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
1759 if (!status) { 1765 if (!status) {
1760 entry->mask = 0; 1766 entry->mask = 0;
@@ -1764,6 +1770,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
1764 entry->mask |= MAY_WRITE; 1770 entry->mask |= MAY_WRITE;
1765 if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE)) 1771 if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE))
1766 entry->mask |= MAY_EXEC; 1772 entry->mask |= MAY_EXEC;
1773 nfs_refresh_inode(inode, &fattr);
1767 } 1774 }
1768 return status; 1775 return status;
1769} 1776}