diff options
author | Jens Axboe | 2009-09-09 09:10:25 +0200 |
---|---|---|
committer | Jens Axboe | 2009-09-11 09:20:26 +0200 |
commit | 500b067c5e6ceea49cf280a02597b1169320e08c (patch) | |
tree | 5e2e9bfd66f825f845fdf395b6303b884769ff6d /mm/backing-dev.c | |
parent | writeback: add name to backing_dev_info (diff) | |
download | kernel-qcow2-linux-500b067c5e6ceea49cf280a02597b1169320e08c.tar.gz kernel-qcow2-linux-500b067c5e6ceea49cf280a02597b1169320e08c.tar.xz kernel-qcow2-linux-500b067c5e6ceea49cf280a02597b1169320e08c.zip |
writeback: check for registered bdi in flusher add and inode dirty
Also a debugging aid. We want to catch dirty inodes being added to
backing devices that don't do writeback.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 5cb32c5b93d8..d3ca0dac1111 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -465,6 +465,12 @@ void static bdi_add_default_flusher_task(struct backing_dev_info *bdi) if (!bdi_cap_writeback_dirty(bdi)) return; + if (WARN_ON(!test_bit(BDI_registered, &bdi->state))) { + printk(KERN_ERR "bdi %p/%s is not registered!\n", + bdi, bdi->name); + return; + } + /* * Check with the helper whether to proceed adding a task. Will only * abort if we two or more simultanous calls to @@ -528,6 +534,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, } bdi_debug_register(bdi, dev_name(dev)); + set_bit(BDI_registered, &bdi->state); exit: return ret; } |