aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.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/super.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/super.c')
-rw-r--r--fs/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c
index 7e9dd4cc2c01..0d89e93f654e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -71,6 +71,7 @@ static struct super_block *alloc_super(struct file_system_type *type)
71#else 71#else
72 INIT_LIST_HEAD(&s->s_files); 72 INIT_LIST_HEAD(&s->s_files);
73#endif 73#endif
74 s->s_bdi = &default_backing_dev_info;
74 INIT_LIST_HEAD(&s->s_instances); 75 INIT_LIST_HEAD(&s->s_instances);
75 INIT_HLIST_BL_HEAD(&s->s_anon); 76 INIT_HLIST_BL_HEAD(&s->s_anon);
76 INIT_LIST_HEAD(&s->s_inodes); 77 INIT_LIST_HEAD(&s->s_inodes);
@@ -1003,6 +1004,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
1003 } 1004 }
1004 BUG_ON(!mnt->mnt_sb); 1005 BUG_ON(!mnt->mnt_sb);
1005 WARN_ON(!mnt->mnt_sb->s_bdi); 1006 WARN_ON(!mnt->mnt_sb->s_bdi);
1007 WARN_ON(mnt->mnt_sb->s_bdi == &default_backing_dev_info);
1006 mnt->mnt_sb->s_flags |= MS_BORN; 1008 mnt->mnt_sb->s_flags |= MS_BORN;
1007 1009
1008 error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata); 1010 error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata);