diff mbox

[4/5] exportfs: slight reorganization of reconnect loop

Message ID 1381869574-10662-5-git-send-email-bfields@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bruce Fields Oct. 15, 2013, 8:39 p.m. UTC
From: "J. Bruce Fields" <bfields@redhat.com>

Just cleanup, no change in functionality

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/exportfs/expfs.c |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

Comments

Christoph Hellwig Oct. 16, 2013, 7:19 a.m. UTC | #1
On Tue, Oct 15, 2013 at 04:39:32PM -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
> 
> Just cleanup, no change in functionality

Looks reasonable, but as said I'd have just turned the root check into a
BUG_ON earlier.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index 24fb763..afa7c9c 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -208,19 +208,23 @@  reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf)
 			/* must have found a connected parent - great */
 			clear_disconnected(target_dir);
 			noprogress = 0;
-		} else if (dentry == mnt->mnt_sb->s_root) {
+			dput(dentry);
+			continue;
+		}
+		if (dentry == mnt->mnt_sb->s_root) {
 			printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
 			clear_disconnected(target_dir);
 			noprogress = 0;
-		} else {
-			/*
-			 * We have hit the top of a disconnected path, try to
-			 * find parent and connect.
-			 */
-			err = reconnect_one(mnt, dentry, nbuf, &noprogress);
-			if (err)
-				return err;
+			dput(dentry);
+			continue;
 		}
+		/*
+		 * We have hit the top of a disconnected path, try to
+		 * find parent and connect.
+		 */
+		err = reconnect_one(mnt, dentry, nbuf, &noprogress);
+		if (err)
+			return err;
 		dput(dentry);
 	}