mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
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>
This commit is contained in:
parent
d993831fa7
commit
500b067c5e
3 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue