aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/rpc_pipe.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:49 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:49 -0500
commit5428154827c2bf7cfdc9dab60db1e0eaa57c027a (patch)
treeec2e6c9119ad76cad353a50da2be3ac71adbf54d /net/sunrpc/rpc_pipe.c
parenta9a801787a761616589a6526d7a29c13f4deb3d8 (diff)
SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r--net/sunrpc/rpc_pipe.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 72b22172f0af..391d2bfc71aa 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -435,14 +435,17 @@ static struct rpc_filelist authfiles[] = {
435 }, 435 },
436}; 436};
437 437
438static int 438struct vfsmount *rpc_get_mount(void)
439rpc_get_mount(void)
440{ 439{
441 return simple_pin_fs("rpc_pipefs", &rpc_mount, &rpc_mount_count); 440 int err;
441
442 err = simple_pin_fs("rpc_pipefs", &rpc_mount, &rpc_mount_count);
443 if (err != 0)
444 return ERR_PTR(err);
445 return rpc_mount;
442} 446}
443 447
444static void 448void rpc_put_mount(void)
445rpc_put_mount(void)
446{ 449{
447 simple_release_fs(&rpc_mount, &rpc_mount_count); 450 simple_release_fs(&rpc_mount, &rpc_mount_count);
448} 451}
@@ -452,12 +455,13 @@ rpc_lookup_parent(char *path, struct nameidata *nd)
452{ 455{
453 if (path[0] == '\0') 456 if (path[0] == '\0')
454 return -ENOENT; 457 return -ENOENT;
455 if (rpc_get_mount()) { 458 nd->mnt = rpc_get_mount();
459 if (IS_ERR(nd->mnt)) {
456 printk(KERN_WARNING "%s: %s failed to mount " 460 printk(KERN_WARNING "%s: %s failed to mount "
457 "pseudofilesystem \n", __FILE__, __FUNCTION__); 461 "pseudofilesystem \n", __FILE__, __FUNCTION__);
458 return -ENODEV; 462 return PTR_ERR(nd->mnt);
459 } 463 }
460 nd->mnt = mntget(rpc_mount); 464 mntget(nd->mnt);
461 nd->dentry = dget(rpc_mount->mnt_root); 465 nd->dentry = dget(rpc_mount->mnt_root);
462 nd->last_type = LAST_ROOT; 466 nd->last_type = LAST_ROOT;
463 nd->flags = LOOKUP_PARENT; 467 nd->flags = LOOKUP_PARENT;
@@ -594,7 +598,6 @@ __rpc_mkdir(struct inode *dir, struct dentry *dentry)
594 d_instantiate(dentry, inode); 598 d_instantiate(dentry, inode);
595 dir->i_nlink++; 599 dir->i_nlink++;
596 inode_dir_notify(dir, DN_CREATE); 600 inode_dir_notify(dir, DN_CREATE);
597 rpc_get_mount();
598 return 0; 601 return 0;
599out_err: 602out_err:
600 printk(KERN_WARNING "%s: %s failed to allocate inode for dentry %s\n", 603 printk(KERN_WARNING "%s: %s failed to allocate inode for dentry %s\n",
@@ -615,7 +618,6 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry)
615 if (!error) { 618 if (!error) {
616 inode_dir_notify(dir, DN_DELETE); 619 inode_dir_notify(dir, DN_DELETE);
617 d_drop(dentry); 620 d_drop(dentry);
618 rpc_put_mount();
619 } 621 }
620 return 0; 622 return 0;
621} 623}