aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-04-28 11:32:21 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-28 13:22:19 -0400
commit71dfc5fa5160bb73752f0731539404569a77faca (patch)
treed35919ad0d645b91404ca0d1717e5ffa00e89ae5 /fs
parente245d4250d0326cfcf7c816a2081b6ab2ea810be (diff)
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 <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/idmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index b7f348bb618b..ba3019f5934c 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,
554 struct nfs_client *clp; 554 struct nfs_client *clp;
555 int error = 0; 555 int error = 0;
556 556
557 if (!try_module_get(THIS_MODULE))
558 return 0;
559
557 while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) { 560 while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) {
558 error = __rpc_pipefs_event(clp, event, sb); 561 error = __rpc_pipefs_event(clp, event, sb);
559 nfs_put_client(clp); 562 nfs_put_client(clp);
560 if (error) 563 if (error)
561 break; 564 break;
562 } 565 }
566 module_put(THIS_MODULE);
563 return error; 567 return error;
564} 568}
565 569