mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -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
|
|
@ -33,7 +33,7 @@ static int __sync_filesystem(struct super_block *sb, int wait)
|
|||
* This should be safe, as we require bdi backing to actually
|
||||
* write out data in the first place
|
||||
*/
|
||||
if (!sb->s_bdi || sb->s_bdi == &noop_backing_dev_info)
|
||||
if (sb->s_bdi == &noop_backing_dev_info)
|
||||
return 0;
|
||||
|
||||
if (sb->s_qcop && sb->s_qcop->quota_sync)
|
||||
|
|
@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(sync_filesystem);
|
|||
|
||||
static void sync_one_sb(struct super_block *sb, void *arg)
|
||||
{
|
||||
if (!(sb->s_flags & MS_RDONLY) && sb->s_bdi)
|
||||
if (!(sb->s_flags & MS_RDONLY))
|
||||
__sync_filesystem(sb, *(int *)arg);
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue