Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157488
b: refs/heads/master
c: 500b067
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed Sep 11, 2009
1 parent 9ba82d0 commit 2d9bf2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d993831fa7ffeb89e994f046f93eeb09ec91df08
refs/heads/master: 500b067c5e6ceea49cf280a02597b1169320e08c
8 changes: 8 additions & 0 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,14 @@ void __mark_inode_dirty(struct inode *inode, int flags)
*/
if (!was_dirty) {
struct bdi_writeback *wb = &inode_to_bdi(inode)->wb;
struct backing_dev_info *bdi = wb->bdi;

if (bdi_cap_writeback_dirty(bdi) &&
!test_bit(BDI_registered, &bdi->state)) {
WARN_ON(1);
printk(KERN_ERR "bdi-%s not registered\n",
bdi->name);
}

inode->dirtied_when = jiffies;
list_move(&inode->i_list, &wb->b_dirty);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/backing-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum bdi_state {
BDI_wb_alloc, /* Default embedded wb allocated */
BDI_async_congested, /* The async (write) queue is getting full */
BDI_sync_congested, /* The sync queue is getting full */
BDI_registered, /* bdi_register() was done */
BDI_unused, /* Available bits start here */
};

Expand Down
7 changes: 7 additions & 0 deletions trunk/mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2d9bf2d

Please sign in to comment.