Skip to content

Commit

Permalink
NFS: get module in idmap PipeFS notifier callback
Browse files Browse the repository at this point in the history
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: Stanislav Kinsbursky <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Stanislav Kinsbursky authored and Trond Myklebust committed Apr 28, 2012
1 parent e245d42 commit 71dfc5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,16 @@ static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
struct nfs_client *clp;
int error = 0;

if (!try_module_get(THIS_MODULE))
return 0;

while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) {
error = __rpc_pipefs_event(clp, event, sb);
nfs_put_client(clp);
if (error)
break;
}
module_put(THIS_MODULE);
return error;
}

Expand Down

0 comments on commit 71dfc5f

Please sign in to comment.