diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-08-10 17:45:11 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:18:38 -0400 |
commit | 76b32999dfff6e59252a8af17a5671a4cf3bcf9b (patch) | |
tree | 6494e3a368e120668052e469c08c69a5d8d0b3f4 /fs/nfs/nfs4proc.c | |
parent | af22f94ae02ab9dd4fd7fe628c8434a59cc293be (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.c | 11 |
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; | |||
62 | static int _nfs4_proc_open(struct nfs4_opendata *data); | 62 | static int _nfs4_proc_open(struct nfs4_opendata *data); |
63 | static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); | 63 | static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); |
64 | static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *); | 64 | static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *); |
65 | static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry); | ||
66 | static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception); | 65 | static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception); |
67 | static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp); | 66 | static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp); |
68 | static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr); | 67 | static 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 | ||
1727 | static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) | 1726 | static 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 | } |