From: Kinglong Mee <kinglongmee@gmail.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
kinglongmee@gmail.com
Subject: [PATCH 2/7 v2] NFS: Error out when register_shrinker fail in register_nfs_fs
Date: Thu, 30 Jul 2015 21:41:08 +0800 [thread overview]
Message-ID: <55BA2974.6000206@gmail.com> (raw)
In-Reply-To: <55BA290B.2020704@gmail.com>
Commit 1d3d4437ea "vmscan: per-node deferred work" have made
register_shrinker can return an intergater error.
If register_shrinker() fail, the later unregister_shrinker() will
cause a NULL pointer access.
v2, same as v1.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
fs/nfs/super.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index aa62004..383a027 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -381,9 +381,12 @@ int __init register_nfs_fs(void)
ret = nfs_register_sysctl();
if (ret < 0)
goto error_2;
- register_shrinker(&acl_shrinker);
+ ret = register_shrinker(&acl_shrinker);
+ if (ret < 0)
+ goto error_3;
return 0;
-
+error_3:
+ nfs_unregister_sysctl();
error_2:
unregister_nfs4_fs();
error_1:
--
2.4.3
next prev parent reply other threads:[~2015-07-30 13:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 13:39 [PATCH 0/7 v2] Some bugfixes and exclcreat supports Kinglong Mee
2015-07-30 13:40 ` [PATCH 1/7] NFS: Remove duplicate svc_xprt_put from nfs41_callback_up Kinglong Mee
2015-07-30 13:41 ` [PATCH 3/7 v2] NFS: Check size by inode_newsize_ok in nfs_setattr Kinglong Mee
2015-08-04 10:43 ` Kinglong Mee
2015-08-26 0:10 ` Trond Myklebust
2015-07-30 13:42 ` [PATCH 4/7] NFS: Make opened as optional argument in _nfs4_do_open Kinglong Mee
2015-07-30 13:42 ` [PATCH 4/7 v2] " Kinglong Mee
2015-07-30 13:41 ` Kinglong Mee [this message]
2015-07-30 13:43 ` [PATCH 5/7 v2] NFS: Update NFS4_BITMAP_SIZE Kinglong Mee
2015-07-30 13:44 ` [PATCH 6/7 v2] NFS: Get suppattr_exclcreat when getting server, capabilities Kinglong Mee
2015-07-30 13:45 ` [PATCH 7/7 v2] NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1 Kinglong Mee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BA2974.6000206@gmail.com \
--to=kinglongmee@gmail.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.