diff options
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index e7ce4b3eb0bd..4679df5a6d50 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -667,7 +667,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, | |||
667 | return ERR_PTR(-ENOMEM); | 667 | return ERR_PTR(-ENOMEM); |
668 | } | 668 | } |
669 | if (dentry->d_inode == NULL) { | 669 | if (dentry->d_inode == NULL) { |
670 | d_set_d_op(dentry, &rpc_dentry_operations); | 670 | if (!dentry->d_op) |
671 | d_set_d_op(dentry, &rpc_dentry_operations); | ||
671 | return dentry; | 672 | return dentry; |
672 | } | 673 | } |
673 | dput(dentry); | 674 | dput(dentry); |
@@ -1126,6 +1127,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) | |||
1126 | return -ENOMEM; | 1127 | return -ENOMEM; |
1127 | dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n", | 1128 | dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n", |
1128 | net, NET_NAME(net)); | 1129 | net, NET_NAME(net)); |
1130 | mutex_lock(&sn->pipefs_sb_lock); | ||
1129 | sn->pipefs_sb = sb; | 1131 | sn->pipefs_sb = sb; |
1130 | err = blocking_notifier_call_chain(&rpc_pipefs_notifier_list, | 1132 | err = blocking_notifier_call_chain(&rpc_pipefs_notifier_list, |
1131 | RPC_PIPEFS_MOUNT, | 1133 | RPC_PIPEFS_MOUNT, |
@@ -1133,6 +1135,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) | |||
1133 | if (err) | 1135 | if (err) |
1134 | goto err_depopulate; | 1136 | goto err_depopulate; |
1135 | sb->s_fs_info = get_net(net); | 1137 | sb->s_fs_info = get_net(net); |
1138 | mutex_unlock(&sn->pipefs_sb_lock); | ||
1136 | return 0; | 1139 | return 0; |
1137 | 1140 | ||
1138 | err_depopulate: | 1141 | err_depopulate: |
@@ -1141,6 +1144,7 @@ err_depopulate: | |||
1141 | sb); | 1144 | sb); |
1142 | sn->pipefs_sb = NULL; | 1145 | sn->pipefs_sb = NULL; |
1143 | __rpc_depopulate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF); | 1146 | __rpc_depopulate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF); |
1147 | mutex_unlock(&sn->pipefs_sb_lock); | ||
1144 | return err; | 1148 | return err; |
1145 | } | 1149 | } |
1146 | 1150 | ||
@@ -1162,12 +1166,12 @@ static void rpc_kill_sb(struct super_block *sb) | |||
1162 | goto out; | 1166 | goto out; |
1163 | } | 1167 | } |
1164 | sn->pipefs_sb = NULL; | 1168 | sn->pipefs_sb = NULL; |
1165 | mutex_unlock(&sn->pipefs_sb_lock); | ||
1166 | dprintk("RPC: sending pipefs UMOUNT notification for net %p%s\n", | 1169 | dprintk("RPC: sending pipefs UMOUNT notification for net %p%s\n", |
1167 | net, NET_NAME(net)); | 1170 | net, NET_NAME(net)); |
1168 | blocking_notifier_call_chain(&rpc_pipefs_notifier_list, | 1171 | blocking_notifier_call_chain(&rpc_pipefs_notifier_list, |
1169 | RPC_PIPEFS_UMOUNT, | 1172 | RPC_PIPEFS_UMOUNT, |
1170 | sb); | 1173 | sb); |
1174 | mutex_unlock(&sn->pipefs_sb_lock); | ||
1171 | put_net(net); | 1175 | put_net(net); |
1172 | out: | 1176 | out: |
1173 | kill_litter_super(sb); | 1177 | kill_litter_super(sb); |