diff options
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 759666966c6d..2627f0dfcd9c 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -1180,6 +1180,8 @@ void writeback_inodes_sb(struct super_block *sb) | |||
1180 | .sync_mode = WB_SYNC_NONE, | 1180 | .sync_mode = WB_SYNC_NONE, |
1181 | }; | 1181 | }; |
1182 | 1182 | ||
1183 | WARN_ON(!rwsem_is_locked(&sb->s_umount)); | ||
1184 | |||
1183 | args.nr_pages = nr_dirty + nr_unstable + | 1185 | args.nr_pages = nr_dirty + nr_unstable + |
1184 | (inodes_stat.nr_inodes - inodes_stat.nr_unused); | 1186 | (inodes_stat.nr_inodes - inodes_stat.nr_unused); |
1185 | 1187 | ||
@@ -1197,7 +1199,9 @@ EXPORT_SYMBOL(writeback_inodes_sb); | |||
1197 | int writeback_inodes_sb_if_idle(struct super_block *sb) | 1199 | int writeback_inodes_sb_if_idle(struct super_block *sb) |
1198 | { | 1200 | { |
1199 | if (!writeback_in_progress(sb->s_bdi)) { | 1201 | if (!writeback_in_progress(sb->s_bdi)) { |
1202 | down_read(&sb->s_umount); | ||
1200 | writeback_inodes_sb(sb); | 1203 | writeback_inodes_sb(sb); |
1204 | up_read(&sb->s_umount); | ||
1201 | return 1; | 1205 | return 1; |
1202 | } else | 1206 | } else |
1203 | return 0; | 1207 | return 0; |
@@ -1220,6 +1224,8 @@ void sync_inodes_sb(struct super_block *sb) | |||
1220 | .range_cyclic = 0, | 1224 | .range_cyclic = 0, |
1221 | }; | 1225 | }; |
1222 | 1226 | ||
1227 | WARN_ON(!rwsem_is_locked(&sb->s_umount)); | ||
1228 | |||
1223 | bdi_queue_work_onstack(&args); | 1229 | bdi_queue_work_onstack(&args); |
1224 | wait_sb_inodes(sb); | 1230 | wait_sb_inodes(sb); |
1225 | } | 1231 | } |