mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
We don't have proper reference counting for this yet, so we run into cases where the device is pulled and we OOPS on flushing the fs data. This happens even though the dirty inodes have already been migrated to the default_backing_dev_info. Reported-by: Torsten Hilbrich <[email protected]> Tested-by: Torsten Hilbrich <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
a91a2785b2
commit
95f28604a6
3 changed files with 5 additions and 3 deletions
|
|
@ -71,6 +71,7 @@ static struct super_block *alloc_super(struct file_system_type *type)
|
|||
#else
|
||||
INIT_LIST_HEAD(&s->s_files);
|
||||
#endif
|
||||
s->s_bdi = &default_backing_dev_info;
|
||||
INIT_LIST_HEAD(&s->s_instances);
|
||||
INIT_HLIST_BL_HEAD(&s->s_anon);
|
||||
INIT_LIST_HEAD(&s->s_inodes);
|
||||
|
|
@ -1003,6 +1004,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
|
|||
}
|
||||
BUG_ON(!mnt->mnt_sb);
|
||||
WARN_ON(!mnt->mnt_sb->s_bdi);
|
||||
WARN_ON(mnt->mnt_sb->s_bdi == &default_backing_dev_info);
|
||||
mnt->mnt_sb->s_flags |= MS_BORN;
|
||||
|
||||
error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata);
|
||||
|
|
|
|||
Loading…
Reference in a new issue