aboutsummaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-03-17 11:13:12 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-27 11:36:26 -0700
commit857754c982ffd7af7683cb5d39288db65c990bad (patch)
treedbf6db3feb3c27572df90f60a4dafd0293a66c45 /fs/super.c
parent305c88ab06302e186aba8376a2b5c579a5c92291 (diff)
fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
commit 95f28604a65b1c40b6c6cd95e58439cd7ded3add upstream. 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> Signed-off-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 7e9dd4cc2c0..0d89e93f654 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -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);