aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sync.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-03-17 06:13:12 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-03-17 06:13:12 -0400
commit95f28604a65b1c40b6c6cd95e58439cd7ded3add (patch)
tree25b3be2d5505f06b2262bade8d1ecf5323c47ff8 /fs/sync.c
parenta91a2785b200864aef2270ed6a3babac7a253a20 (diff)
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 <torsten.hilbrich@secunet.com> Tested-by: Torsten Hilbrich <torsten.hilbrich@secunet.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/sync.c')
-rw-r--r--fs/sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/sync.c b/fs/sync.c
index ba76b9623e7e..412dc89163d3 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -33,7 +33,7 @@ static int __sync_filesystem(struct super_block *sb, int wait)
33 * This should be safe, as we require bdi backing to actually 33 * This should be safe, as we require bdi backing to actually
34 * write out data in the first place 34 * write out data in the first place
35 */ 35 */
36 if (!sb->s_bdi || sb->s_bdi == &noop_backing_dev_info) 36 if (sb->s_bdi == &noop_backing_dev_info)
37 return 0; 37 return 0;
38 38
39 if (sb->s_qcop && sb->s_qcop->quota_sync) 39 if (sb->s_qcop && sb->s_qcop->quota_sync)
@@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(sync_filesystem);
79 79
80static void sync_one_sb(struct super_block *sb, void *arg) 80static void sync_one_sb(struct super_block *sb, void *arg)
81{ 81{
82 if (!(sb->s_flags & MS_RDONLY) && sb->s_bdi) 82 if (!(sb->s_flags & MS_RDONLY))
83 __sync_filesystem(sb, *(int *)arg); 83 __sync_filesystem(sb, *(int *)arg);
84} 84}
85/* 85/*