Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7493
b: refs/heads/master
c: 4407c2b
h: refs/heads/master
i:
  7491: 51f719b
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Sep 7, 2005
1 parent 1f8d496 commit 82cfcae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 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: e39f07c83bac96850265b87a69dfc5c90ed4f1f5
refs/heads/master: 4407c2b6b297339e296facf62e020cf66e55053d
39 changes: 21 additions & 18 deletions trunk/fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,23 +490,21 @@ void journal_unlock_updates (journal_t *journal)
*/
static void jbd_unexpected_dirty_buffer(struct journal_head *jh)
{
struct buffer_head *bh = jh2bh(jh);
int jlist;

if (buffer_dirty(bh)) {
/* If this buffer is one which might reasonably be dirty
* --- ie. data, or not part of this journal --- then
* we're OK to leave it alone, but otherwise we need to
* move the dirty bit to the journal's own internal
* JBDDirty bit. */
jlist = jh->b_jlist;

if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
jlist == BJ_Shadow || jlist == BJ_Forget) {
if (test_clear_buffer_dirty(jh2bh(jh))) {
set_bit(BH_JBDDirty, &jh2bh(jh)->b_state);
}
}
/* If this buffer is one which might reasonably be dirty
* --- ie. data, or not part of this journal --- then
* we're OK to leave it alone, but otherwise we need to
* move the dirty bit to the journal's own internal
* JBDDirty bit. */
jlist = jh->b_jlist;

if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
jlist == BJ_Shadow || jlist == BJ_Forget) {
struct buffer_head *bh = jh2bh(jh);

if (test_clear_buffer_dirty(bh))
set_buffer_jbddirty(bh);
}
}

Expand Down Expand Up @@ -574,9 +572,14 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
if (jh->b_next_transaction)
J_ASSERT_JH(jh, jh->b_next_transaction ==
transaction);
JBUFFER_TRACE(jh, "Unexpected dirty buffer");
jbd_unexpected_dirty_buffer(jh);
}
}
/*
* In any case we need to clean the dirty flag and we must
* do it under the buffer lock to be sure we don't race
* with running write-out.
*/
JBUFFER_TRACE(jh, "Unexpected dirty buffer");
jbd_unexpected_dirty_buffer(jh);
}

unlock_buffer(bh);
Expand Down

0 comments on commit 82cfcae

Please sign in to comment.