summaryrefslogtreecommitdiffstats
path: root/fs/nfs/idmap.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-08-22 20:06:09 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:32 -0400
commitb7162792b5c0e0f6e91b8997f8e6bbc76ec5420a (patch)
tree214c0aec3cee41cf872e0c4940fa778f6c0f94e9 /fs/nfs/idmap.c
parent7539bbab8062aadc1db95a22b377146843cfa88f (diff)
downloadop-kernel-dev-b7162792b5c0e0f6e91b8997f8e6bbc76ec5420a.zip
op-kernel-dev-b7162792b5c0e0f6e91b8997f8e6bbc76ec5420a.tar.gz
NFS: Return an error when starting the idmapping pipe
Return an error when starting the idmapping pipe so that we can detect it failing. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r--fs/nfs/idmap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index d05148e..231c20f 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -108,15 +108,17 @@ static struct rpc_pipe_ops idmap_upcall_ops = {
.destroy_msg = idmap_pipe_destroy_msg,
};
-void
+int
nfs_idmap_new(struct nfs_client *clp)
{
struct idmap *idmap;
+ int error;
if (clp->cl_idmap != NULL)
- return;
+ return 0;
+
if ((idmap = kzalloc(sizeof(*idmap), GFP_KERNEL)) == NULL)
- return;
+ return -ENOMEM;
snprintf(idmap->idmap_path, sizeof(idmap->idmap_path),
"%s/idmap", clp->cl_rpcclient->cl_pathname);
@@ -124,8 +126,9 @@ nfs_idmap_new(struct nfs_client *clp)
idmap->idmap_dentry = rpc_mkpipe(idmap->idmap_path,
idmap, &idmap_upcall_ops, 0);
if (IS_ERR(idmap->idmap_dentry)) {
+ error = PTR_ERR(idmap->idmap_dentry);
kfree(idmap);
- return;
+ return error;
}
mutex_init(&idmap->idmap_lock);
@@ -135,6 +138,7 @@ nfs_idmap_new(struct nfs_client *clp)
idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP;
clp->cl_idmap = idmap;
+ return 0;
}
void
OpenPOWER on IntegriCloud