lkml.org 
[lkml]   [2009]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/12] writeback: check for registered bdi in flusher add
Date
Also a debugging aid.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
---
include/linux/backing-dev.h | 1 +
mm/backing-dev.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3d373d4..c65b219 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -29,6 +29,7 @@ enum bdi_state {
BDI_wblist_lock, /* bdi->wb_list now needs locking */
BDI_write_congested, /* The write queue is getting full */
BDI_read_congested, /* The read queue is getting full */
+ BDI_registered,
BDI_unused, /* Available bits start here */
};

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 981e8e8..18faf79 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -474,6 +474,11 @@ void bdi_add_flusher_task(struct backing_dev_info *bdi)
if (!bdi_cap_writeback_dirty(bdi))
return;

+ if (!test_bit(BDI_registered, &bdi->state)) {
+ printk("bdi %p/%s is not registered!\n", bdi, bdi->name);
+ return;
+ }
+
/*
* Someone already marked this pending for task creation
*/
@@ -541,6 +546,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,

bdi->dev = dev;
bdi_debug_register(bdi, dev_name(dev));
+ set_bit(BDI_registered, &bdi->state);

exit:
return ret;
--
1.6.2.12.g83676


\
 
 \ /
  Last update: 2009-03-22 20:33    [W:0.078 / U:4.976 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site