diff mbox

SUNRPC: Ensure rpc_fill_super sets sb->s_fs_info before calling notifiers

Message ID 1411698242-126323-1-git-send-email-trond.myklebust@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust Sept. 26, 2014, 2:24 a.m. UTC
The rpc_pipefs event handlers expect the sb->s_fs_info field to contain
the net namespace. Ensure that we set it before we call the notifier list.

Fixes: 2d00131acc64 (SUNRPC: send notification events on pipefs sb creation...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 net/sunrpc/rpc_pipe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 2d12b76b5a64..17d685680c46 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1414,12 +1414,12 @@  rpc_fill_super(struct super_block *sb, void *data, int silent)
 		net, NET_NAME(net));
 	mutex_lock(&sn->pipefs_sb_lock);
 	sn->pipefs_sb = sb;
+	sb->s_fs_info = get_net(net);
 	err = blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
 					   RPC_PIPEFS_MOUNT,
 					   sb);
 	if (err)
 		goto err_depopulate;
-	sb->s_fs_info = get_net(net);
 	mutex_unlock(&sn->pipefs_sb_lock);
 	return 0;
 
@@ -1431,6 +1431,7 @@  err_depopulate:
 	sn->pipefs_sb = NULL;
 	__rpc_depopulate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF);
 	mutex_unlock(&sn->pipefs_sb_lock);
+	put_net(net);
 	return err;
 }