From: Stanislav Kinsbursky Date: Sat, 28 Apr 2012 15:32:21 +0000 (+0400) Subject: NFS: get module in idmap PipeFS notifier callback X-Git-Tag: v3.4-rc7~17^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71dfc5fa5160bb73752f0731539404569a77faca;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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: Stanislav Kinsbursky Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index b7f348b..ba3019f 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c @@ -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; }