Loading fs/nfs/nfs3proc.c +10 −7 Original line number Diff line number Diff line Loading @@ -181,13 +181,10 @@ nfs3_proc_lookup(struct inode *dir, struct qstr *name, static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) { struct nfs_fattr fattr; struct nfs3_accessargs arg = { .fh = NFS_FH(inode), }; struct nfs3_accessres res = { .fattr = &fattr, }; struct nfs3_accessres res; struct rpc_message msg = { .rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS], .rpc_argp = &arg, Loading @@ -195,7 +192,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) .rpc_cred = entry->cred, }; int mode = entry->mask; int status; int status = -ENOMEM; dprintk("NFS call access\n"); Loading @@ -212,9 +209,13 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) if (mode & MAY_EXEC) arg.access |= NFS3_ACCESS_EXECUTE; } nfs_fattr_init(&fattr); res.fattr = nfs_alloc_fattr(); if (res.fattr == NULL) goto out; status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_refresh_inode(inode, &fattr); nfs_refresh_inode(inode, res.fattr); if (status == 0) { entry->mask = 0; if (res.access & NFS3_ACCESS_READ) Loading @@ -224,6 +225,8 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) if (res.access & (NFS3_ACCESS_LOOKUP|NFS3_ACCESS_EXECUTE)) entry->mask |= MAY_EXEC; } nfs_free_fattr(res.fattr); out: dprintk("NFS reply access: %d\n", status); return status; } Loading fs/nfs/nfs4proc.c +7 −4 Original line number Diff line number Diff line Loading @@ -2404,14 +2404,12 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) { struct nfs_server *server = NFS_SERVER(inode); struct nfs_fattr fattr; struct nfs4_accessargs args = { .fh = NFS_FH(inode), .bitmask = server->attr_bitmask, }; struct nfs4_accessres res = { .server = server, .fattr = &fattr, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS], Loading @@ -2438,7 +2436,11 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry if (mode & MAY_EXEC) args.access |= NFS4_ACCESS_EXECUTE; } nfs_fattr_init(&fattr); res.fattr = nfs_alloc_fattr(); if (res.fattr == NULL) return -ENOMEM; status = nfs4_call_sync(server, &msg, &args, &res, 0); if (!status) { entry->mask = 0; Loading @@ -2448,8 +2450,9 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry entry->mask |= MAY_WRITE; if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE)) entry->mask |= MAY_EXEC; nfs_refresh_inode(inode, &fattr); nfs_refresh_inode(inode, res.fattr); } nfs_free_fattr(res.fattr); return status; } Loading Loading
fs/nfs/nfs3proc.c +10 −7 Original line number Diff line number Diff line Loading @@ -181,13 +181,10 @@ nfs3_proc_lookup(struct inode *dir, struct qstr *name, static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) { struct nfs_fattr fattr; struct nfs3_accessargs arg = { .fh = NFS_FH(inode), }; struct nfs3_accessres res = { .fattr = &fattr, }; struct nfs3_accessres res; struct rpc_message msg = { .rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS], .rpc_argp = &arg, Loading @@ -195,7 +192,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) .rpc_cred = entry->cred, }; int mode = entry->mask; int status; int status = -ENOMEM; dprintk("NFS call access\n"); Loading @@ -212,9 +209,13 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) if (mode & MAY_EXEC) arg.access |= NFS3_ACCESS_EXECUTE; } nfs_fattr_init(&fattr); res.fattr = nfs_alloc_fattr(); if (res.fattr == NULL) goto out; status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_refresh_inode(inode, &fattr); nfs_refresh_inode(inode, res.fattr); if (status == 0) { entry->mask = 0; if (res.access & NFS3_ACCESS_READ) Loading @@ -224,6 +225,8 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) if (res.access & (NFS3_ACCESS_LOOKUP|NFS3_ACCESS_EXECUTE)) entry->mask |= MAY_EXEC; } nfs_free_fattr(res.fattr); out: dprintk("NFS reply access: %d\n", status); return status; } Loading
fs/nfs/nfs4proc.c +7 −4 Original line number Diff line number Diff line Loading @@ -2404,14 +2404,12 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) { struct nfs_server *server = NFS_SERVER(inode); struct nfs_fattr fattr; struct nfs4_accessargs args = { .fh = NFS_FH(inode), .bitmask = server->attr_bitmask, }; struct nfs4_accessres res = { .server = server, .fattr = &fattr, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS], Loading @@ -2438,7 +2436,11 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry if (mode & MAY_EXEC) args.access |= NFS4_ACCESS_EXECUTE; } nfs_fattr_init(&fattr); res.fattr = nfs_alloc_fattr(); if (res.fattr == NULL) return -ENOMEM; status = nfs4_call_sync(server, &msg, &args, &res, 0); if (!status) { entry->mask = 0; Loading @@ -2448,8 +2450,9 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry entry->mask |= MAY_WRITE; if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE)) entry->mask |= MAY_EXEC; nfs_refresh_inode(inode, &fattr); nfs_refresh_inode(inode, res.fattr); } nfs_free_fattr(res.fattr); return status; } Loading