sget(): handle failures of register_shrinker()

Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Al Viro committed 2017-12-18 15:05:07 -05:00
1 parent bb422a738f
commit 9ee332d99e
1 file changed
+5 -1
+5 -1
View File
@@ -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;
}