Commit 161fb0cf authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  SUNRPC: AUTH_SYS "machine creds" shouldn't use negative valued uid/gid
  nfs: make nfs4_drop_state_owner() static
  nfs: path_{get,put}() cleanups
  nfs: replace remaining __FUNCTION__ occurrences
  nfs/lsm: make NFSv4 set LSM mount options
  NFSv4: Check the return value of decode_compound_hdr_arg()
  nfs: fix race in nfs_dirty_request
  NFS: Ensure that 'noac' and/or 'actimeo=0' turn off attribute caching
parents b8291ad0 b4528762
...@@ -182,7 +182,7 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp) ...@@ -182,7 +182,7 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
if (clp == NULL) if (clp == NULL)
return SVC_DROP; return SVC_DROP;
dprintk("%s: %s NFSv4 callback!\n", __FUNCTION__, dprintk("%s: %s NFSv4 callback!\n", __func__,
svc_print_addr(rqstp, buf, sizeof(buf))); svc_print_addr(rqstp, buf, sizeof(buf)));
nfs_put_client(clp); nfs_put_client(clp);
......
...@@ -57,7 +57,7 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres * ...@@ -57,7 +57,7 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *
out_putclient: out_putclient:
nfs_put_client(clp); nfs_put_client(clp);
out: out:
dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(res->status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status));
return res->status; return res->status;
} }
...@@ -98,6 +98,6 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy) ...@@ -98,6 +98,6 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
nfs_put_client(prev); nfs_put_client(prev);
} while (clp != NULL); } while (clp != NULL);
out: out:
dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(res)); dprintk("%s: exit with status = %d\n", __func__, ntohl(res));
return res; return res;
} }
...@@ -141,7 +141,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound ...@@ -141,7 +141,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
/* We do not like overly long tags! */ /* We do not like overly long tags! */
if (hdr->taglen > CB_OP_TAGLEN_MAXSZ - 12) { if (hdr->taglen > CB_OP_TAGLEN_MAXSZ - 12) {
printk("NFSv4 CALLBACK %s: client sent tag of length %u\n", printk("NFSv4 CALLBACK %s: client sent tag of length %u\n",
__FUNCTION__, hdr->taglen); __func__, hdr->taglen);
return htonl(NFS4ERR_RESOURCE); return htonl(NFS4ERR_RESOURCE);
} }
p = read_buf(xdr, 12); p = read_buf(xdr, 12);
...@@ -151,7 +151,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound ...@@ -151,7 +151,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
/* Check minor version is zero. */ /* Check minor version is zero. */
if (minor_version != 0) { if (minor_version != 0) {
printk(KERN_WARNING "%s: NFSv4 server callback with illegal minor version %u!\n", printk(KERN_WARNING "%s: NFSv4 server callback with illegal minor version %u!\n",
__FUNCTION__, minor_version); __func__, minor_version);
return htonl(NFS4ERR_MINOR_VERS_MISMATCH); return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
} }
hdr->callback_ident = ntohl(*p++); hdr->callback_ident = ntohl(*p++);
...@@ -179,7 +179,7 @@ static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr ...@@ -179,7 +179,7 @@ static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr
args->addr = svc_addr(rqstp); args->addr = svc_addr(rqstp);
status = decode_bitmap(xdr, args->bitmap); status = decode_bitmap(xdr, args->bitmap);
out: out:
dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
return status; return status;
} }
...@@ -200,7 +200,7 @@ static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, ...@@ -200,7 +200,7 @@ static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr,
args->truncate = ntohl(*p); args->truncate = ntohl(*p);
status = decode_fh(xdr, &args->fh); status = decode_fh(xdr, &args->fh);
out: out:
dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
return status; return status;
} }
...@@ -349,7 +349,7 @@ static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, ...@@ -349,7 +349,7 @@ static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr,
status = encode_attr_mtime(xdr, res->bitmap, &res->mtime); status = encode_attr_mtime(xdr, res->bitmap, &res->mtime);
*savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1))); *savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1)));
out: out:
dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
return status; return status;
} }
...@@ -363,7 +363,7 @@ static __be32 process_op(struct svc_rqst *rqstp, ...@@ -363,7 +363,7 @@ static __be32 process_op(struct svc_rqst *rqstp,
long maxlen; long maxlen;
__be32 res; __be32 res;
dprintk("%s: start\n", __FUNCTION__); dprintk("%s: start\n", __func__);
status = decode_op_hdr(xdr_in, &op_nr); status = decode_op_hdr(xdr_in, &op_nr);
if (likely(status == 0)) { if (likely(status == 0)) {
switch (op_nr) { switch (op_nr) {
...@@ -392,7 +392,7 @@ static __be32 process_op(struct svc_rqst *rqstp, ...@@ -392,7 +392,7 @@ static __be32 process_op(struct svc_rqst *rqstp,
status = res; status = res;
if (op->encode_res != NULL && status == 0) if (op->encode_res != NULL && status == 0)
status = op->encode_res(rqstp, xdr_out, resp); status = op->encode_res(rqstp, xdr_out, resp);
dprintk("%s: done, status = %d\n", __FUNCTION__, ntohl(status)); dprintk("%s: done, status = %d\n", __func__, ntohl(status));
return status; return status;
} }
...@@ -401,37 +401,37 @@ static __be32 process_op(struct svc_rqst *rqstp, ...@@ -401,37 +401,37 @@ static __be32 process_op(struct svc_rqst *rqstp,
*/ */
static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp) static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp)
{ {
struct cb_compound_hdr_arg hdr_arg; struct cb_compound_hdr_arg hdr_arg = { 0 };
struct cb_compound_hdr_res hdr_res; struct cb_compound_hdr_res hdr_res = { NULL };
struct xdr_stream xdr_in, xdr_out; struct xdr_stream xdr_in, xdr_out;
__be32 *p; __be32 *p;
__be32 status; __be32 status;
unsigned int nops = 1; unsigned int nops = 0;
dprintk("%s: start\n", __FUNCTION__); dprintk("%s: start\n", __func__);
xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base); xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len); p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
xdr_init_encode(&xdr_out, &rqstp->rq_res, p); xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
decode_compound_hdr_arg(&xdr_in, &hdr_arg); status = decode_compound_hdr_arg(&xdr_in, &hdr_arg);
if (status == __constant_htonl(NFS4ERR_RESOURCE))
return rpc_garbage_args;
hdr_res.taglen = hdr_arg.taglen; hdr_res.taglen = hdr_arg.taglen;
hdr_res.tag = hdr_arg.tag; hdr_res.tag = hdr_arg.tag;
hdr_res.nops = NULL; if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0)
encode_compound_hdr_res(&xdr_out, &hdr_res); return rpc_system_err;
for (;;) { while (status == 0 && nops != hdr_arg.nops) {
status = process_op(rqstp, &xdr_in, argp, &xdr_out, resp); status = process_op(rqstp, &xdr_in, argp, &xdr_out, resp);
if (status != 0)
break;
if (nops == hdr_arg.nops)
break;
nops++; nops++;
} }
*hdr_res.status = status; *hdr_res.status = status;
*hdr_res.nops = htonl(nops); *hdr_res.nops = htonl(nops);
dprintk("%s: done, status = %u\n", __FUNCTION__, ntohl(status)); dprintk("%s: done, status = %u\n", __func__, ntohl(status));
return rpc_success; return rpc_success;
} }
......
...@@ -488,7 +488,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp, ...@@ -488,7 +488,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp,
clnt = rpc_create(&args); clnt = rpc_create(&args);
if (IS_ERR(clnt)) { if (IS_ERR(clnt)) {
dprintk("%s: cannot create RPC client. Error = %ld\n", dprintk("%s: cannot create RPC client. Error = %ld\n",
__FUNCTION__, PTR_ERR(clnt)); __func__, PTR_ERR(clnt));
return PTR_ERR(clnt); return PTR_ERR(clnt);
} }
...@@ -576,7 +576,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server, ...@@ -576,7 +576,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server,
server->client = rpc_clone_client(clp->cl_rpcclient); server->client = rpc_clone_client(clp->cl_rpcclient);
if (IS_ERR(server->client)) { if (IS_ERR(server->client)) {
dprintk("%s: couldn't create rpc_client!\n", __FUNCTION__); dprintk("%s: couldn't create rpc_client!\n", __func__);
return PTR_ERR(server->client); return PTR_ERR(server->client);
} }
...@@ -590,7 +590,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server, ...@@ -590,7 +590,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server,
auth = rpcauth_create(pseudoflavour, server->client); auth = rpcauth_create(pseudoflavour, server->client);
if (IS_ERR(auth)) { if (IS_ERR(auth)) {
dprintk("%s: couldn't create credcache!\n", __FUNCTION__); dprintk("%s: couldn't create credcache!\n", __func__);
return PTR_ERR(auth); return PTR_ERR(auth);
} }
} }
...@@ -985,7 +985,7 @@ static int nfs4_init_client(struct nfs_client *clp, ...@@ -985,7 +985,7 @@ static int nfs4_init_client(struct nfs_client *clp,
error = nfs_idmap_new(clp); error = nfs_idmap_new(clp);
if (error < 0) { if (error < 0) {
dprintk("%s: failed to create idmapper. Error = %d\n", dprintk("%s: failed to create idmapper. Error = %d\n",
__FUNCTION__, error); __func__, error);
goto error; goto error;
} }
__set_bit(NFS_CS_IDMAP, &clp->cl_res_state); __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
......
...@@ -60,7 +60,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ ...@@ -60,7 +60,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
switch (status) { switch (status) {
default: default:
printk(KERN_ERR "%s: unhandled error %d.\n", printk(KERN_ERR "%s: unhandled error %d.\n",
__FUNCTION__, status); __func__, status);
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
/* kill_proc(fl->fl_pid, SIGLOST, 1); */ /* kill_proc(fl->fl_pid, SIGLOST, 1); */
case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_CLIENTID:
...@@ -186,7 +186,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct ...@@ -186,7 +186,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
*/ */
dfprintk(FILE, "%s: server %s handed out " dfprintk(FILE, "%s: server %s handed out "
"a duplicate delegation!\n", "a duplicate delegation!\n",
__FUNCTION__, clp->cl_hostname); __func__, clp->cl_hostname);
if (delegation->type <= nfsi->delegation->type) { if (delegation->type <= nfsi->delegation->type) {
freeme = delegation; freeme = delegation;
delegation = NULL; delegation = NULL;
......
...@@ -180,7 +180,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) ...@@ -180,7 +180,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
int error; int error;
dfprintk(DIRCACHE, "NFS: %s: reading cookie %Lu into page %lu\n", dfprintk(DIRCACHE, "NFS: %s: reading cookie %Lu into page %lu\n",
__FUNCTION__, (long long)desc->entry->cookie, __func__, (long long)desc->entry->cookie,
page->index); page->index);
again: again:
...@@ -256,7 +256,7 @@ int find_dirent(nfs_readdir_descriptor_t *desc) ...@@ -256,7 +256,7 @@ int find_dirent(nfs_readdir_descriptor_t *desc)
while((status = dir_decode(desc)) == 0) { while((status = dir_decode(desc)) == 0) {
dfprintk(DIRCACHE, "NFS: %s: examining cookie %Lu\n", dfprintk(DIRCACHE, "NFS: %s: examining cookie %Lu\n",
__FUNCTION__, (unsigned long long)entry->cookie); __func__, (unsigned long long)entry->cookie);
if (entry->prev_cookie == *desc->dir_cookie) if (entry->prev_cookie == *desc->dir_cookie)
break; break;
if (loop_count++ > 200) { if (loop_count++ > 200) {
...@@ -315,7 +315,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc) ...@@ -315,7 +315,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc)
int status; int status;
dfprintk(DIRCACHE, "NFS: %s: searching page %ld for target %Lu\n", dfprintk(DIRCACHE, "NFS: %s: searching page %ld for target %Lu\n",
__FUNCTION__, desc->page_index, __func__, desc->page_index,
(long long) *desc->dir_cookie); (long long) *desc->dir_cookie);
/* If we find the page in the page_cache, we cannot be sure /* If we find the page in the page_cache, we cannot be sure
...@@ -339,7 +339,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc) ...@@ -339,7 +339,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc)
if (status < 0) if (status < 0)
dir_page_release(desc); dir_page_release(desc);
out: out:
dfprintk(DIRCACHE, "NFS: %s: returns %d\n", __FUNCTION__, status); dfprintk(DIRCACHE, "NFS: %s: returns %d\n", __func__, status);
return status; return status;
} }
...@@ -380,7 +380,7 @@ int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) ...@@ -380,7 +380,7 @@ int readdir_search_pagecache(nfs_readdir_descriptor_t *desc)
} }
} }
dfprintk(DIRCACHE, "NFS: %s: returns %d\n", __FUNCTION__, res); dfprintk(DIRCACHE, "NFS: %s: returns %d\n", __func__, res);
return res; return res;
} }
...@@ -506,7 +506,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, ...@@ -506,7 +506,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
desc->entry->eof = 0; desc->entry->eof = 0;
out: out:
dfprintk(DIRCACHE, "NFS: %s: returns %d\n", dfprintk(DIRCACHE, "NFS: %s: returns %d\n",
__FUNCTION__, status); __func__, status);
return status; return status;
out_release: out_release:
dir_page_release(desc); dir_page_release(desc);
...@@ -780,7 +780,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -780,7 +780,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
if (is_bad_inode(inode)) { if (is_bad_inode(inode)) {
dfprintk(LOOKUPCACHE, "%s: %s/%s has dud inode\n", dfprintk(LOOKUPCACHE, "%s: %s/%s has dud inode\n",
__FUNCTION__, dentry->d_parent->d_name.name, __func__, dentry->d_parent->d_name.name,
dentry->d_name.name); dentry->d_name.name);
goto out_bad; goto out_bad;
} }
...@@ -808,7 +808,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -808,7 +808,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
unlock_kernel(); unlock_kernel();
dput(parent); dput(parent);
dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is valid\n", dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is valid\n",
__FUNCTION__, dentry->d_parent->d_name.name, __func__, dentry->d_parent->d_name.name,
dentry->d_name.name); dentry->d_name.name);
return 1; return 1;
out_zap_parent: out_zap_parent:
...@@ -827,7 +827,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -827,7 +827,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
unlock_kernel(); unlock_kernel();
dput(parent); dput(parent);
dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n", dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n",
__FUNCTION__, dentry->d_parent->d_name.name, __func__, dentry->d_parent->d_name.name,
dentry->d_name.name); dentry->d_name.name);
return 0; return 0;
} }
......
...@@ -526,7 +526,7 @@ static int do_vfs_lock(struct file *file, struct file_lock *fl) ...@@ -526,7 +526,7 @@ static int do_vfs_lock(struct file *file, struct file_lock *fl)
if (res < 0) if (res < 0)
dprintk(KERN_WARNING "%s: VFS is out of sync with lock manager" dprintk(KERN_WARNING "%s: VFS is out of sync with lock manager"
" - error %d!\n", " - error %d!\n",
__FUNCTION__, res); __func__, res);
return res; return res;
} }
......
...@@ -541,8 +541,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait) ...@@ -541,8 +541,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait)
} }
if (ctx->cred != NULL) if (ctx->cred != NULL)
put_rpccred(ctx->cred); put_rpccred(ctx->cred);
dput(ctx->path.dentry); path_put(&ctx->path);
mntput(ctx->path.mnt);
kfree(ctx); kfree(ctx);
} }
...@@ -707,6 +706,13 @@ int nfs_attribute_timeout(struct inode *inode) ...@@ -707,6 +706,13 @@ int nfs_attribute_timeout(struct inode *inode)
if (nfs_have_delegation(inode, FMODE_READ)) if (nfs_have_delegation(inode, FMODE_READ))
return 0; return 0;
/*
* Special case: if the attribute timeout is set to 0, then always
* treat the cache as having expired (unless holding
* a delegation).
*/
if (nfsi->attrtimeo == 0)
return 1;
return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo); return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
} }
...@@ -995,7 +1001,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) ...@@ -995,7 +1001,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
unsigned long now = jiffies; unsigned long now = jiffies;
dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n", dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
__FUNCTION__, inode->i_sb->s_id, inode->i_ino, __func__, inode->i_sb->s_id, inode->i_ino,
atomic_read(&inode->i_count), fattr->valid); atomic_read(&inode->i_count), fattr->valid);
if (nfsi->fileid != fattr->fileid) if (nfsi->fileid != fattr->fileid)
...@@ -1119,7 +1125,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) ...@@ -1119,7 +1125,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
* Big trouble! The inode has become a different object. * Big trouble! The inode has become a different object.
*/ */
printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n", printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n",
__FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode); __func__, inode->i_ino, inode->i_mode, fattr->mode);
out_err: out_err:
/* /*
* No need to worry about unhashing the dentry, as the * No need to worry about unhashing the dentry, as the
......
...@@ -106,7 +106,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) ...@@ -106,7 +106,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
dprintk("--> nfs_follow_mountpoint()\n"); dprintk("--> nfs_follow_mountpoint()\n");
BUG_ON(IS_ROOT(dentry)); BUG_ON(IS_ROOT(dentry));
dprintk("%s: enter\n", __FUNCTION__); dprintk("%s: enter\n", __func__);
dput(nd->path.dentry); dput(nd->path.dentry);
nd->path.dentry = dget(dentry); nd->path.dentry = dget(dentry);
...@@ -137,13 +137,12 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) ...@@ -137,13 +137,12 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
goto out_follow; goto out_follow;
goto out_err; goto out_err;
} }
mntput(nd->path.mnt); path_put(&nd->path);
dput(nd->path.dentry);
nd->path.mnt = mnt; nd->path.mnt = mnt;
nd->path.dentry = dget(mnt->mnt_root); nd->path.dentry = dget(mnt->mnt_root);
schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout); schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
out: out:
dprintk("%s: done, returned %d\n", __FUNCTION__, err); dprintk("%s: done, returned %d\n", __func__, err);
dprintk("<-- nfs_follow_mountpoint() = %d\n", err); dprintk("<-- nfs_follow_mountpoint() = %d\n", err);
return ERR_PTR(err); return ERR_PTR(err);
...@@ -230,7 +229,7 @@ static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, ...@@ -230,7 +229,7 @@ static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent,
dprintk("--> nfs_do_submount()\n"); dprintk("--> nfs_do_submount()\n");
dprintk("%s: submounting on %s/%s\n", __FUNCTION__, dprintk("%s: submounting on %s/%s\n", __func__,
dentry->d_parent->d_name.name, dentry->d_parent->d_name.name,
dentry->d_name.name); dentry->d_name.name);
if (page == NULL) if (page == NULL)
...@@ -243,7 +242,7 @@ static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, ...@@ -243,7 +242,7 @@ static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent,
free_page: free_page:
free_page((unsigned long)page); free_page((unsigned long)page);
out: out:
dprintk("%s: done\n", __FUNCTION__); dprintk("%s: done\n", __func__);
dprintk("<-- nfs_do_submount() = %p\n", mnt); dprintk("<-- nfs_do_submount() = %p\n", mnt);
return mnt; return mnt;
......
...@@ -63,15 +63,15 @@ do_proc_get_root(struct rpc_clnt *client, struct nfs_fh *fhandle, ...@@ -63,15 +63,15 @@ do_proc_get_root(struct rpc_clnt *client, struct nfs_fh *fhandle,
}; };
int status; int status;
dprintk("%s: call fsinfo\n", __FUNCTION__); dprintk("%s: call fsinfo\n", __func__);
nfs_fattr_init(info->fattr); nfs_fattr_init(info->fattr);
status = rpc_call_sync(client, &msg, 0); status = rpc_call_sync(client, &msg, 0);
dprintk("%s: reply fsinfo: %d\n", __FUNCTION__, status); dprintk("%s: reply fsinfo: %d\n", __func__, status);
if (!(info->fattr->valid & NFS_ATTR_FATTR)) { if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR]; msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
msg.rpc_resp = info->fattr; msg.rpc_resp = info->fattr;
status = rpc_call_sync(client, &msg, 0); status = rpc_call_sync(client, &msg, 0);
dprintk("%s: reply getattr: %d\n", __FUNCTION__, status); dprintk("%s: reply getattr: %d\n", __func__, status);
} }
return status; return status;
} }
......
...@@ -206,7 +206,6 @@ struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp); ...@@ -206,7 +206,6 @@ struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp);
extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *);
extern void nfs4_put_state_owner(struct nfs4_state_owner *); extern void nfs4_put_state_owner(struct nfs4_state_owner *);
extern void nfs4_drop_state_owner(struct nfs4_state_owner *);
extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *); extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
extern void nfs4_put_open_state(struct nfs4_state *); extern void nfs4_put_open_state(struct nfs4_state *);
extern void nfs4_close_state(struct path *, struct nfs4_state *, mode_t); extern void nfs4_close_state(struct path *, struct nfs4_state *, mode_t);
......
...@@ -86,7 +86,7 @@ static int nfs4_validate_fspath(const struct vfsmount *mnt_parent, ...@@ -86,7 +86,7 @@ static int nfs4_validate_fspath(const struct vfsmount *mnt_parent,
if (strncmp(path, fs_path, strlen(fs_path)) != 0) { if (strncmp(path, fs_path, strlen(fs_path)) != 0) {
dprintk("%s: path %s does not begin with fsroot %s\n", dprintk("%s: path %s does not begin with fsroot %s\n",
__FUNCTION__, path, fs_path); __func__, path, fs_path);
return -ENOENT; return -ENOENT;
} }
...@@ -134,7 +134,7 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent, ...@@ -134,7 +134,7 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
if (locations == NULL || locations->nlocations <= 0) if (locations == NULL || locations->nlocations <= 0)
goto out; goto out;
dprintk("%s: referral at %s/%s\n", __FUNCTION__, dprintk("%s: referral at %s/%s\n", __func__,
dentry->d_parent->d_name.name, dentry->d_name.name); dentry->d_parent->d_name.name, dentry->d_name.name);
page = (char *) __get_free_page(GFP_USER); page = (char *) __get_free_page(GFP_USER);
...@@ -204,7 +204,7 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent, ...@@ -204,7 +204,7 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
out: out:
free_page((unsigned long) page); free_page((unsigned long) page);
free_page((unsigned long) page2); free_page((unsigned long) page2);
dprintk("%s: done\n", __FUNCTION__); dprintk("%s: done\n", __func__);
return mnt; return mnt;
} }
...@@ -223,7 +223,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr ...@@ -223,7 +223,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr
int err; int err;
/* BUG_ON(IS_ROOT(dentry)); */ /* BUG_ON(IS_ROOT(dentry)); */
dprintk("%s: enter\n", __FUNCTION__); dprintk("%s: enter\n", __func__);
page = alloc_page(GFP_KERNEL); page = alloc_page(GFP_KERNEL);
if (page == NULL) if (page == NULL)
...@@ -238,7 +238,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr ...@@ -238,7 +238,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr
parent = dget_parent(dentry); parent = dget_parent(dentry);
dprintk("%s: getting locations for %s/%s\n", dprintk("%s: getting locations for %s/%s\n",
__FUNCTION__, parent->d_name.name, dentry->d_name.name); __func__, parent->d_name.name, dentry->d_name.name);
err = nfs4_proc_fs_locations(parent->d_inode, &dentry->d_name, fs_locations, page); err = nfs4_proc_fs_locations(parent->d_inode, &dentry->d_name, fs_locations, page);
dput(parent); dput(parent);
...@@ -252,6 +252,6 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr ...@@ -252,6 +252,6 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr
__free_page(page); __free_page(page);
kfree(fs_locations); kfree(fs_locations);
out: out:
dprintk("%s: done\n", __FUNCTION__); dprintk("%s: done\n", __func__);
return mnt; return mnt;
} }
...@@ -73,7 +73,7 @@ int nfs4_map_errors(int err) ...@@ -73,7 +73,7 @@ int nfs4_map_errors(int err)
{ {
if (err < -1000) { if (err < -1000) {
dprintk("%s could not handle NFSv4 error %d\n", dprintk("%s could not handle NFSv4 error %d\n",
__FUNCTION__, -err); __func__, -err);
return -EIO; return -EIO;
} }
return err; return err;
...@@ -306,8 +306,7 @@ static void nfs4_opendata_free(struct kref *kref) ...@@ -306,8 +306,7 @@ static void nfs4_opendata_free(struct kref *kref)
nfs4_put_open_state(p->state); nfs4_put_open_state(p->state);
nfs4_put_state_owner(p->owner); nfs4_put_state_owner(p->owner);
dput(p->dir); dput(p->dir);
dput(p->path.dentry); path_put(&p->path);
mntput(p->path.mnt);
kfree(p); kfree(p);
} }
...@@ -1210,8 +1209,7 @@ static void nfs4_free_closedata(void *data) ...@@ -1210,8 +1209,7 @@ static void nfs4_free_closedata(void *data)
nfs4_put_open_state(calldata->state); nfs4_put_open_state(calldata->state);
nfs_free_seqid(calldata->arg.seqid); nfs_free_seqid(calldata->arg.seqid);
nfs4_put_state_owner(sp); nfs4_put_state_owner(sp);
dput(calldata->path.dentry); path_put(&calldata->path);
mntput(calldata->path.mnt);
kfree(calldata); kfree(calldata);
} }
...@@ -1578,7 +1576,7 @@ static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct ...@@ -1578,7 +1576,7 @@ static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct
goto out; goto out;
/* Make sure server returned a different fsid for the referral */ /* Make sure server returned a different fsid for the referral */
if (nfs_fsid_equal(&NFS_SERVER(dir)->fsid, &locations->fattr.fsid)) { if (nfs_fsid_equal(&NFS_SERVER(dir)->fsid, &locations->fattr.fsid)) {
dprintk("%s: server did not return a different fsid for a referral at %s\n", __FUNCTION__, name->name); dprintk("%s: server did not return a different fsid for a referral at %s\n", __func__, name->name);
status = -EIO; status = -EIO;
goto out; goto out;
} }
...@@ -2211,7 +2209,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, ...@@ -2211,7 +2209,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
}; };
int status; int status;
dprintk("%s: dentry = %s/%s, cookie = %Lu\n", __FUNCTION__, dprintk("%s: dentry = %s/%s, cookie = %Lu\n", __func__,
dentry->d_parent->d_name.name, dentry->d_parent->d_name.name,
dentry->d_name.name, dentry->d_name.name,
(unsigned long long)cookie); (unsigned long long)cookie);
...@@ -2223,7 +2221,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, ...@@ -2223,7 +2221,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
nfs_invalidate_atime(dir); nfs_invalidate_atime(dir);
dprintk("%s: returns %d\n", __FUNCTION__, status); dprintk("%s: returns %d\n", __func__, status);
return status; return status;
} }
...@@ -3342,7 +3340,7 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata) ...@@ -3342,7 +3340,7 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata)
struct nfs4_lockdata *data = calldata; struct nfs4_lockdata *data = calldata;
struct nfs4_state *state = data->lsp->ls_state; struct nfs4_state *state = data->lsp->ls_state;
dprintk("%s: begin!\n", __FUNCTION__); dprintk("%s: begin!\n", __func__);
if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0) if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0)
return; return;
/* Do we need to do an open_to_lock_owner? */ /* Do we need to do an open_to_lock_owner? */
...@@ -3356,14 +3354,14 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata) ...@@ -3356,14 +3354,14 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata)
data->arg.new_lock_owner = 0; data->arg.new_lock_owner = 0;
data->timestamp = jiffies; data->timestamp = jiffies;
rpc_call_start(task); rpc_call_start(task);
dprintk("%s: done!, ret = %d\n", __FUNCTION__, data->rpc_status); dprintk("%s: done!, ret = %d\n", __func__, data->rpc_status);
} }
static void nfs4_lock_done(struct rpc_task *task, void *calldata) static void nfs4_lock_done(struct rpc_task *task, void *calldata)
{ {
struct nfs4_lockdata *data = calldata; struct nfs4_lockdata *data = calldata;
dprintk("%s: begin!\n", __FUNCTION__); dprintk("%s: begin!\n", __func__);
data->rpc_status = task->tk_status; data->rpc_status = task->tk_status;
if (RPC_ASSASSINATED(task)) if (RPC_ASSASSINATED(task))
...@@ -3381,14 +3379,14 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) ...@@ -3381,14 +3379,14 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
renew_lease(NFS_SERVER(data->ctx->path.dentry->d_inode), data->timestamp); renew_lease(NFS_SERVER(data->ctx->path.dentry->d_inode), data->timestamp);
} }
out: out:
dprintk("%s: done, ret = %d!\n", __FUNCTION__, data->rpc_status); dprintk("%s: done, ret = %d!\n", __func__, data->rpc_status);
} }
static void nfs4_lock_release(void *calldata) static void nfs4_lock_release(void *calldata)
{ {
struct nfs4_lockdata *data = calldata; struct nfs4_lockdata *data = calldata;
dprintk("%s: begin!\n", __FUNCTION__); dprintk("%s: begin!\n", __func__);
nfs_free_seqid(data->arg.open_seqid); nfs_free_seqid(data->arg.open_seqid);
if (data->cancelled != 0) { if (data->cancelled != 0) {
struct rpc_task *task; struct rpc_task *task;
...@@ -3396,13 +3394,13 @@ static void nfs4_lock_release(void *calldata) ...@@ -3396,13 +3394,13 @@ static void nfs4_lock_release(void *calldata)
data->arg.lock_seqid); data->arg.lock_seqid);
if (!IS_ERR(task)) if (!IS_ERR(task))
rpc_put_task(task); rpc_put_task(task);
dprintk("%s: cancelling lock!\n", __FUNCTION__); dprintk("%s: cancelling lock!\n", __func__);
} else } else
nfs_free_seqid(data->arg.lock_seqid); nfs_free_seqid(data->arg.lock_seqid);
nfs4_put_lock_state(data->lsp); nfs4_put_lock_state(data->lsp);
put_nfs_open_context(data->ctx); put_nfs_open_context(data->ctx);
kfree(data); kfree(data);
dprintk("%s: done!\n", __FUNCTION__); dprintk("%s: done!\n", __func__);
} }
static const struct rpc_call_ops nfs4_lock_ops = { static const struct rpc_call_ops nfs4_lock_ops = {
...@@ -3428,7 +3426,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f ...@@ -3428,7 +3426,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
}; };
int ret; int ret;
dprintk("%s: begin!\n", __FUNCTION__); dprintk("%s: begin!\n", __func__);
data = nfs4_alloc_lockdata(fl, nfs_file_open_context(fl->fl_file), data = nfs4_alloc_lockdata(fl, nfs_file_open_context(fl->fl_file),
fl->fl_u.nfs4_fl.owner); fl->fl_u.nfs4_fl.owner);
if (data == NULL) if (data == NULL)
...@@ -3451,7 +3449,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f ...@@ -3451,7 +3449,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
} else } else
data->cancelled = 1; data->cancelled = 1;
rpc_put_task(task); rpc_put_task(task);
dprintk("%s: done, ret = %d!\n", __FUNCTION__, ret); dprintk("%s: done, ret = %d!\n", __func__, ret);
return ret; return ret;
} }
...@@ -3527,7 +3525,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock ...@@ -3527,7 +3525,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
/* Note: we always want to sleep here! */ /* Note: we always want to sleep here! */
request->fl_flags = fl_flags | FL_SLEEP; request->fl_flags = fl_flags | FL_SLEEP;
if (do_vfs_lock(request->fl_file, request) < 0) if (do_vfs_lock(request->fl_file, request) < 0)
printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__); printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __func__);
out_unlock: out_unlock:
up_read(&clp->cl_sem); up_read(&clp->cl_sem);
out: out:
...@@ -3665,12 +3663,12 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, ...@@ -3665,12 +3663,12 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
}; };
int status; int status;
dprintk("%s: start\n", __FUNCTION__); dprintk("%s: start\n", __func__);
nfs_fattr_init(&fs_locations->fattr); nfs_fattr_init(&fs_locations->fattr);
fs_locations->server = server; fs_locations->server = server;
fs_locations->nlocations = 0; fs_locations->nlocations = 0;
status = rpc_call_sync(server->client, &msg, 0); status = rpc_call_sync(server->client, &msg, 0);
dprintk("%s: returned status = %d\n", __FUNCTION__, status); dprintk("%s: returned status = %d\n", __func__, status);
return status; return status;
} }
......
...@@ -66,7 +66,7 @@ nfs4_renew_state(struct work_struct *work) ...@@ -66,7 +66,7 @@ nfs4_renew_state(struct work_struct *work)
unsigned long last, now; unsigned long last, now;
down_read(&clp->cl_sem); down_read(&clp->cl_sem);
dprintk("%s: start\n", __FUNCTION__); dprintk("%s: start\n", __func__);
/* Are there any active superblocks? */ /* Are there any active superblocks? */
if (list_empty(&clp->cl_superblocks)) if (list_empty(&clp->cl_superblocks))
goto out; goto out;
...@@ -92,17 +92,17 @@ nfs4_renew_state(struct work_struct *work) ...@@ -92,17 +92,17 @@ nfs4_renew_state(struct work_struct *work)
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
} else } else
dprintk("%s: failed to call renewd. Reason: lease not expired \n", dprintk("%s: failed to call renewd. Reason: lease not expired \n",
__FUNCTION__); __func__);
if (timeout < 5 * HZ) /* safeguard */ if (timeout < 5 * HZ) /* safeguard */
timeout = 5 * HZ; timeout = 5 * HZ;
dprintk("%s: requeueing work. Lease period = %ld\n", dprintk("%s: requeueing work. Lease period = %ld\n",
__FUNCTION__, (timeout + HZ - 1) / HZ); __func__, (timeout + HZ - 1) / HZ);
cancel_delayed_work(&clp->cl_renewd); cancel_delayed_work(&clp->cl_renewd);
schedule_delayed_work(&clp->cl_renewd, timeout); schedule_delayed_work(&clp->cl_renewd, timeout);
spin_unlock(&clp->cl_lock); spin_unlock(&clp->cl_lock);
out: out:
up_read(&clp->cl_sem); up_read(&clp->cl_sem);
dprintk("%s: done\n", __FUNCTION__); dprintk("%s: done\n", __func__);
} }
/* Must be called with clp->cl_sem locked for writes */ /* Must be called with clp->cl_sem locked for writes */
...@@ -117,7 +117,7 @@ nfs4_schedule_state_renewal(struct nfs_client *clp) ...@@ -117,7 +117,7 @@ nfs4_schedule_state_renewal(struct nfs_client *clp)
if (timeout < 5 * HZ) if (timeout < 5 * HZ)
timeout = 5 * HZ; timeout = 5 * HZ;
dprintk("%s: requeueing work. Lease period = %ld\n", dprintk("%s: requeueing work. Lease period = %ld\n",
__FUNCTION__, (timeout + HZ - 1) / HZ); __func__, (timeout + HZ - 1) / HZ);
cancel_delayed_work(&clp->cl_renewd); cancel_delayed_work(&clp->cl_renewd);
schedule_delayed_work(&clp->cl_renewd, timeout); schedule_delayed_work(&clp->cl_renewd, timeout);
set_bit(NFS_CS_RENEWD, &clp->cl_res_state); set_bit(NFS_CS_RENEWD, &clp->cl_res_state);
......
...@@ -282,7 +282,7 @@ nfs4_alloc_state_owner(void) ...@@ -282,7 +282,7 @@ nfs4_alloc_state_owner(void)
return sp; return sp;
} }
void static void
nfs4_drop_state_owner(struct nfs4_state_owner *sp) nfs4_drop_state_owner(struct nfs4_state_owner *sp)
{ {
if (!RB_EMPTY_NODE(&sp->so_client_node)) { if (!RB_EMPTY_NODE(&sp->so_client_node)) {
...@@ -828,7 +828,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s ...@@ -828,7 +828,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
switch (status) { switch (status) {
default: default:
printk(KERN_ERR "%s: unhandled error %d. Zeroing state\n", printk(KERN_ERR "%s: unhandled error %d. Zeroing state\n",
__FUNCTION__, status); __func__, status);
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
case -NFS4ERR_NO_GRACE: case -NFS4ERR_NO_GRACE:
case -NFS4ERR_RECLAIM_BAD: case -NFS4ERR_RECLAIM_BAD:
...@@ -869,14 +869,14 @@ static int nfs4_reclaim_open_state(struct nfs4_state_recovery_ops *ops, struct n ...@@ -869,14 +869,14 @@ static int nfs4_reclaim_open_state(struct nfs4_state_recovery_ops *ops, struct n
list_for_each_entry(lock, &state->lock_states, ls_locks) { list_for_each_entry(lock, &state->lock_states, ls_locks) {
if (!(lock->ls_flags & NFS_LOCK_INITIALIZED)) if (!(lock->ls_flags & NFS_LOCK_INITIALIZED))
printk("%s: Lock reclaim failed!\n", printk("%s: Lock reclaim failed!\n",
__FUNCTION__); __func__);
} }
continue; continue;
} }
switch (status) { switch (status) {
default: default:
printk(KERN_ERR "%s: unhandled error %d. Zeroing state\n", printk(KERN_ERR "%s: unhandled error %d. Zeroing state\n",
__FUNCTION__, status); __func__, status);
case -ENOENT: case -ENOENT:
case -NFS4ERR_RECLAIM_BAD: case -NFS4ERR_RECLAIM_BAD:
case -NFS4ERR_RECLAIM_CONFLICT: case -NFS4ERR_RECLAIM_CONFLICT:
......
This diff is collapsed.
...@@ -63,17 +63,17 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -63,17 +63,17 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
}; };
int status; int status;
dprintk("%s: call getattr\n", __FUNCTION__); dprintk("%s: call getattr\n", __func__);
nfs_fattr_init(fattr); nfs_fattr_init(fattr);
status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0); status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
dprintk("%s: reply getattr: %d\n", __FUNCTION__, status); dprintk("%s: reply getattr: %d\n", __func__, status);
if (status) if (status)
return status; return status;
dprintk("%s: call statfs\n", __FUNCTION__); dprintk("%s: call statfs\n", __func__);
msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS]; msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS];
msg.rpc_resp = &fsinfo; msg.rpc_resp = &fsinfo;
status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0); status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
dprintk("%s: reply statfs: %d\n", __FUNCTION__, status); dprintk("%s: reply statfs: %d\n", __func__, status);
if (status) if (status)
return status; return status;
info->rtmax = NFS_MAXDATA; info->rtmax = NFS_MAXDATA;
......
...@@ -329,7 +329,7 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) ...@@ -329,7 +329,7 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data)
{ {
int status; int status;
dprintk("NFS: %s: %5u, (status %d)\n", __FUNCTION__, task->tk_pid, dprintk("NFS: %s: %5u, (status %d)\n", __func__, task->tk_pid,
task->tk_status); task->tk_status);
status = NFS_PROTO(data->inode)->read_done(task, data); status = NFS_PROTO(data->inode)->read_done(task, data);
......
...@@ -405,7 +405,7 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) ...@@ -405,7 +405,7 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
return 0; return 0;
out_err: out_err:
dprintk("%s: statfs error = %d\n", __FUNCTION__, -error); dprintk("%s: statfs error = %d\n", __func__, -error);
unlock_kernel(); unlock_kernel();
return error; return error;
} }
...@@ -2015,6 +2015,10 @@ static int nfs4_get_sb(struct file_system_type *fs_type, ...@@ -2015,6 +2015,10 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
goto error_splat_super; goto error_splat_super;
} }
error = security_sb_set_mnt_opts(s, &data.lsm_opts);
if (error)
goto error_splat_root;
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
mnt->mnt_sb = s; mnt->mnt_sb = s;
mnt->mnt_root = mntroot; mnt->mnt_root = mntroot;
...@@ -2031,6 +2035,8 @@ static int nfs4_get_sb(struct file_system_type *fs_type, ...@@ -2031,6 +2035,8 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
nfs_free_server(server); nfs_free_server(server);
goto out; goto out;
error_splat_root:
dput(mntroot);
error_splat_super: error_splat_super:
up_write(&s->s_umount); up_write(&s->s_umount);
deactivate_super(s); deactivate_super(s);
...@@ -2114,6 +2120,8 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags, ...@@ -2114,6 +2120,8 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
mnt->mnt_sb = s; mnt->mnt_sb = s;
mnt->mnt_root = mntroot; mnt->mnt_root = mntroot;
security_sb_clone_mnt_opts(data->sb, s);
dprintk("<-- nfs4_xdev_get_sb() = 0\n"); dprintk("<-- nfs4_xdev_get_sb() = 0\n");
return 0; return 0;
...@@ -2197,6 +2205,8 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags, ...@@ -2197,6 +2205,8 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
mnt->mnt_sb = s; mnt->mnt_sb = s;
mnt->mnt_root = mntroot; mnt->mnt_root = mntroot;
security_sb_clone_mnt_opts(data->sb, s);
dprintk("<-- nfs4_referral_get_sb() = 0\n"); dprintk("<-- nfs4_referral_get_sb() = 0\n");
return 0; return 0;
......
...@@ -415,7 +415,7 @@ nfs_dirty_request(struct nfs_page *req) ...@@ -415,7 +415,7 @@ nfs_dirty_request(struct nfs_page *req)
if (page == NULL || test_bit(PG_NEED_COMMIT, &req->wb_flags)) if (page == NULL || test_bit(PG_NEED_COMMIT, &req->wb_flags))
return 0; return 0;
return !PageWriteback(req->wb_page); return !PageWriteback(page);
} }
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
# define RPCDBG_FACILITY RPCDBG_AUTH # define RPCDBG_FACILITY RPCDBG_AUTH
#endif #endif
#define RPC_ANONYMOUS_USERID ((uid_t)-2) #define RPC_MACHINE_CRED_USERID ((uid_t)0)
#define RPC_ANONYMOUS_GROUPID ((gid_t)-2) #define RPC_MACHINE_CRED_GROUPID ((gid_t)0)
struct generic_cred { struct generic_cred {
struct rpc_cred gc_base; struct rpc_cred gc_base;
...@@ -44,8 +44,8 @@ EXPORT_SYMBOL_GPL(rpc_lookup_cred); ...@@ -44,8 +44,8 @@ EXPORT_SYMBOL_GPL(rpc_lookup_cred);
struct rpc_cred *rpc_lookup_machine_cred(void) struct rpc_cred *rpc_lookup_machine_cred(void)
{ {
struct auth_cred acred = { struct auth_cred acred = {
.uid = RPC_ANONYMOUS_USERID, .uid = RPC_MACHINE_CRED_USERID,
.gid = RPC_ANONYMOUS_GROUPID, .gid = RPC_MACHINE_CRED_GROUPID,
.machine_cred = 1, .machine_cred = 1,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment