summaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-12-18 23:05:07 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2017-12-18 23:05:07 +0300
commit9ee332d99e4d5a97548943b81c54668450ce641b (patch)
tree2586e075110c92340cea1baf239b4e34a6133da6 /fs/super.c
parentbb422a738f6566f7439cd347d54e321e4fe92a9f (diff)
downloadlinux-9ee332d99e4d5a97548943b81c54668450ce641b.tar.xz
sget(): handle failures of register_shrinker()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c
index 7ff1349609e4..06bd25d90ba5 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -517,7 +517,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;
}