diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-18 15:05:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-03 10:23:21 +0100 |
commit | fd7cbb5ad8e8b222eff3401089e3244a7a8cb32e (patch) | |
tree | 3bc7521210e8fe2f93f6362f95b61d089ae6d0d6 /fs | |
parent | 9a5bd36c0bb036def9ce7d2300f350a0db36a622 (diff) |
sget(): handle failures of register_shrinker()
[ Upstream commit 9ee332d99e4d5a97548943b81c54668450ce641b ]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/super.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c index 1058bf3e8724..7e9beab77259 100644 --- a/fs/super.c +++ b/fs/super.c @@ -519,7 +519,11 @@ retry: hlist_add_head(&s->s_instances, &type->fs_supers); spin_unlock(&sb_lock); get_filesystem(type); - register_shrinker(&s->s_shrink); + err = register_shrinker(&s->s_shrink); + if (err) { + deactivate_locked_super(s); + s = ERR_PTR(err); + } return s; } |