linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <benny@tonian.com>
To: Jim Rees <rees@umich.edu>, Peng Tao <bergwolf@gmail.com>
Cc: linux-nfs@vger.kernel.org, Benny Halevy <bhalevy@tonian.com>
Subject: [PATCH 2/2] SQUASHME: pnfs: do pnfsiod_start before registering layout drivers
Date: Sun, 11 Sep 2011 08:31:52 -0700	[thread overview]
Message-ID: <1315755112-31248-1-git-send-email-benny@tonian.com> (raw)
In-Reply-To: <4E6CD076.6050607@tonian.com>

From: Benny Halevy <bhalevy@tonian.com>

Signed-off-by: Benny Halevy <bhalevy@tonian.com>
---
 fs/nfs/blocklayout/blocklayout.c |   16 ++++++++--------
 fs/nfs/objlayout/objio_osd.c     |   12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 51f70f0..77bb3e7 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -977,41 +977,41 @@ static int __init nfs4blocklayout_init(void)
 
 	dprintk("%s: NFSv4 Block Layout Driver Registering...\n", __func__);
 
-	ret = pnfs_register_layoutdriver(&blocklayout_type);
+	ret = pnfsiod_start();
 	if (ret)
 		goto out;
 
-	ret = pnfsiod_start();
+	ret = pnfs_register_layoutdriver(&blocklayout_type);
 	if (ret)
-		goto out_remove;
+		goto out_stop;
 
 	init_waitqueue_head(&bl_wq);
 
 	mnt = rpc_get_mount();
 	if (IS_ERR(mnt)) {
 		ret = PTR_ERR(mnt);
-		goto out_stop;
+		goto out_remove;
 	}
 
 	ret = vfs_path_lookup(mnt->mnt_root,
 			      mnt,
 			      NFS_PIPE_DIRNAME, 0, &path);
 	if (ret)
-		goto out_stop;
+		goto out_remove;
 
 	bl_device_pipe = rpc_mkpipe(path.dentry, "blocklayout", NULL,
 				    &bl_upcall_ops, 0);
 	if (IS_ERR(bl_device_pipe)) {
 		ret = PTR_ERR(bl_device_pipe);
-		goto out_stop;
+		goto out_remove;
 	}
 out:
 	return ret;
 
-out_stop:
-	pnfsiod_stop();
 out_remove:
 	pnfs_unregister_layoutdriver(&blocklayout_type);
+out_stop:
+	pnfsiod_stop();
 	return ret;
 }
 
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index f28013f..7e8f0cc 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -1041,15 +1041,15 @@ MODULE_LICENSE("GPL");
 static int __init
 objlayout_init(void)
 {
-	int ret = pnfs_register_layoutdriver(&objlayout_type);
-	if (ret)
-		goto out;
+	int ret;
 
 	ret = pnfsiod_start();
-	if (ret)
-		pnfs_unregister_layoutdriver(&objlayout_type);
+	if (!ret) {
+		ret = pnfs_register_layoutdriver(&objlayout_type);
+		if (ret)
+			pnfsiod_stop();
+	}
 
-out:
 	if (ret)
 		printk(KERN_INFO
 			"%s: Registering OSD pNFS Layout Driver failed: error=%d\n",
-- 
1.7.6


  parent reply	other threads:[~2011-09-11 15:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-10 17:41 [PATCH 0/3] pnfs private workqueue, and two cleanups Jim Rees
2011-09-10 17:41 ` [PATCH 1/3] SUNRPC/NFS: make rpc pipe upcall generic Jim Rees
2011-09-10 17:41 ` [PATCH 2/3] pNFS: introduce pnfs private workqueue Jim Rees
2011-09-11 14:51   ` Benny Halevy
2011-09-11 15:15     ` Benny Halevy
2011-09-11 15:31       ` [PATCH 1/2] SQUASHME: pnfs: simplify and clean up pnfsiod workqueue Benny Halevy
2011-09-11 17:17         ` Jim Rees
2011-09-12 13:31           ` Benny Halevy
2011-09-11 15:31       ` Benny Halevy [this message]
2011-09-10 17:41 ` [PATCH 3/3] pNFS: make _set_lo_fail generic Jim Rees
2011-09-11 16:01 ` [PATCH 0/3] pnfs private workqueue, and two cleanups Benny Halevy
2011-09-11 16:04   ` Benny Halevy
2011-09-11 17:21     ` Jim Rees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315755112-31248-1-git-send-email-benny@tonian.com \
    --to=benny@tonian.com \
    --cc=bergwolf@gmail.com \
    --cc=bhalevy@tonian.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rees@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).