Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19456
b: refs/heads/master
c: d62b1b8
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason authored and Linus Torvalds committed Feb 1, 2006
1 parent 817dcf0 commit e8d79d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 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: ec191574b9c3cb7bfb95e4f803b63f7c8dc52690
refs/heads/master: d62b1b87a7d1c3a21dddabed4251763090be3182
4 changes: 3 additions & 1 deletion trunk/fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
int ret = 1;
struct reiserfs_journal *j = SB_JOURNAL(inode->i_sb);

lock_buffer(bh);
spin_lock(&j->j_dirty_buffers_lock);
if (!buffer_mapped(bh)) {
goto free_jh;
Expand All @@ -2758,7 +2759,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
if (buffer_journaled(bh) || buffer_journal_dirty(bh)) {
ret = 0;
}
} else if (buffer_dirty(bh) || buffer_locked(bh)) {
} else if (buffer_dirty(bh)) {
struct reiserfs_journal_list *jl;
struct reiserfs_jh *jh = bh->b_private;

Expand All @@ -2784,6 +2785,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
reiserfs_free_jh(bh);
}
spin_unlock(&j->j_dirty_buffers_lock);
unlock_buffer(bh);
return ret;
}

Expand Down
13 changes: 13 additions & 0 deletions trunk/fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,19 @@ static int write_ordered_buffers(spinlock_t * lock,
if (!buffer_uptodate(bh)) {
ret = -EIO;
}
/* ugly interaction with invalidatepage here.
* reiserfs_invalidate_page will pin any buffer that has a valid
* journal head from an older transaction. If someone else sets
* our buffer dirty after we write it in the first loop, and
* then someone truncates the page away, nobody will ever write
* the buffer. We're safe if we write the page one last time
* after freeing the journal header.
*/
if (buffer_dirty(bh) && unlikely(bh->b_page->mapping == NULL)) {
spin_unlock(lock);
ll_rw_block(WRITE, 1, &bh);
spin_lock(lock);
}
put_bh(bh);
cond_resched_lock(lock);
}
Expand Down

0 comments on commit e8d79d3

Please sign in to comment.