Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196833
b: refs/heads/master
c: 5547e8a
h: refs/heads/master
i:
  196831: 2bdd173
v: v3
  • Loading branch information
Dmitry Monakhov authored and Jens Axboe committed May 17, 2010
1 parent d3a4637 commit 3977515
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e913fc825dc685a444cb4c1d0f9d32f372f59861
refs/heads/master: 5547e8aac6f71505d621a612de2fca0dd988b439
15 changes: 11 additions & 4 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,9 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)

BUG_ON(inode->i_state & I_SYNC);

/* Set I_SYNC, reset I_DIRTY */
dirty = inode->i_state & I_DIRTY;
/* Set I_SYNC, reset I_DIRTY_PAGES */
inode->i_state |= I_SYNC;
inode->i_state &= ~I_DIRTY;

inode->i_state &= ~I_DIRTY_PAGES;
spin_unlock(&inode_lock);

ret = do_writepages(mapping, wbc);
Expand All @@ -480,6 +478,15 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
ret = err;
}

/*
* Some filesystems may redirty the inode during the writeback
* due to delalloc, clear dirty metadata flags right before
* write_inode()
*/
spin_lock(&inode_lock);
dirty = inode->i_state & I_DIRTY;
inode->i_state &= ~(I_DIRTY_SYNC | I_DIRTY_DATASYNC);
spin_unlock(&inode_lock);
/* Don't write the inode if only I_DIRTY_PAGES was set */
if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
int err = write_inode(inode, wbc);
Expand Down

0 comments on commit 3977515

Please sign in to comment.