--- x/fs/super.c +++ y/fs/super.c @@ -478,7 +478,9 @@ void deactivate_locked_super(struct supe struct file_system_type *fs = s->s_type; if (atomic_dec_and_test(&s->s_active)) { unregister_shrinker(&s->s_shrink); + super_unlock_excl(s); fs->kill_sb(s); + __super_lock_excl(s); kill_super_notify(s); @@ -1624,9 +1626,9 @@ struct dentry *mount_bdev(struct file_sy */ super_unlock_excl(s); error = setup_bdev_super(s, flags, NULL); - __super_lock_excl(s); if (!error) error = fill_super(s, data, flags & SB_SILENT ? 1 : 0); + __super_lock_excl(s); if (error) { deactivate_locked_super(s); return ERR_PTR(error);