OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] NFS: get module in idmap PipeFS notifier callback
[PATCH] NFS: get module in idmap PipeFS notifier callback [message #46161] Sat, 28 April 2012 15:32
Stanislav Kinsbursky is currently offline  Stanislav Kinsbursky
Messages: 683
Registered: October 2011
Senior Member
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>
---
fs/nfs/idmap.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index c9c3e1b..f55b80a 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -557,12 +557,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;
}
Previous Topic: [PATCH v4 0/3] fix problem with static_branch() for sock memcg
Next Topic: [PATCH 0/3] SUNRPC: separate per-net data creation from service creation
Goto Forum:
  


Current Time: Thu May 02 00:14:17 GMT 2024

Total time taken to generate the page: 0.01828 seconds