Commit 71dfc5fa authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Trond Myklebust

NFS: get module in idmap PipeFS notifier callback

This is bug fix.
Notifier callback is called from SUNRPC module. So before dereferencing NFS
module we have to make sure, that it's alive.
Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e245d425
...@@ -554,12 +554,16 @@ static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event, ...@@ -554,12 +554,16 @@ static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
struct nfs_client *clp; struct nfs_client *clp;
int error = 0; int error = 0;
if (!try_module_get(THIS_MODULE))
return 0;
while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) { while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) {
error = __rpc_pipefs_event(clp, event, sb); error = __rpc_pipefs_event(clp, event, sb);
nfs_put_client(clp); nfs_put_client(clp);
if (error) if (error)
break; break;
} }
module_put(THIS_MODULE);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment