diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-09-16 09:02:33 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-16 09:18:51 -0400 |
commit | 32a88aa1b6dfb901cec64e1898cac78d0f25028a (patch) | |
tree | 51aa6f56ccfca53f495d015645373317bdee3647 /fs/sync.c | |
parent | c4a77a6c7dcff04a2abc7fe4b6b2ae605be41c5b (diff) |
fs: Assign bdi in super_block
We do this automatically in get_sb_bdev() from the set_bdev_super()
callback. Filesystems that have their own private backing_dev_info
must assign that in ->fill_super().
Note that ->s_bdi assignment is required for proper writeback!
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/sync.c')
-rw-r--r-- | fs/sync.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -27,6 +27,13 @@ | |||
27 | */ | 27 | */ |
28 | static int __sync_filesystem(struct super_block *sb, int wait) | 28 | static int __sync_filesystem(struct super_block *sb, int wait) |
29 | { | 29 | { |
30 | /* | ||
31 | * This should be safe, as we require bdi backing to actually | ||
32 | * write out data in the first place | ||
33 | */ | ||
34 | if (!sb->s_bdi) | ||
35 | return 0; | ||
36 | |||
30 | /* Avoid doing twice syncing and cache pruning for quota sync */ | 37 | /* Avoid doing twice syncing and cache pruning for quota sync */ |
31 | if (!wait) { | 38 | if (!wait) { |
32 | writeout_quota_sb(sb, -1); | 39 | writeout_quota_sb(sb, -1); |
@@ -101,7 +108,7 @@ restart: | |||
101 | spin_unlock(&sb_lock); | 108 | spin_unlock(&sb_lock); |
102 | 109 | ||
103 | down_read(&sb->s_umount); | 110 | down_read(&sb->s_umount); |
104 | if (!(sb->s_flags & MS_RDONLY) && sb->s_root) | 111 | if (!(sb->s_flags & MS_RDONLY) && sb->s_root && sb->s_bdi) |
105 | __sync_filesystem(sb, wait); | 112 | __sync_filesystem(sb, wait); |
106 | up_read(&sb->s_umount); | 113 | up_read(&sb->s_umount); |
107 | 114 | ||