Skip to content

Commit 9ee332d

Browse files
author
Al Viro
committed
sget(): handle failures of register_shrinker()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent bb422a7 commit 9ee332d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/super.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,11 @@ struct super_block *sget_userns(struct file_system_type *type,
517517
hlist_add_head(&s->s_instances, &type->fs_supers);
518518
spin_unlock(&sb_lock);
519519
get_filesystem(type);
520-
register_shrinker(&s->s_shrink);
520+
err = register_shrinker(&s->s_shrink);
521+
if (err) {
522+
deactivate_locked_super(s);
523+
s = ERR_PTR(err);
524+
}
521525
return s;
522526
}
523527

0 commit comments

Comments
 (0)