Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206325
b: refs/heads/master
c: 56d35a4
h: refs/heads/master
i:
  206323: f1c2458
v: v3
  • Loading branch information
Jan Kara authored and Theodore Ts'o committed Aug 5, 2010
1 parent e7ad2e9 commit ec558fb
Show file tree
Hide file tree
Showing 2 changed files with 18 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: 0cfc9255a1efb0467de2162950197750570ecec0
refs/heads/master: 56d35a4cd13e7bc5eca5b2dba5a41794afb17e11
18 changes: 17 additions & 1 deletion trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,9 +1527,25 @@ static int walk_page_buffers(handle_t *handle,
static int do_journal_get_write_access(handle_t *handle,
struct buffer_head *bh)
{
int dirty = buffer_dirty(bh);
int ret;

if (!buffer_mapped(bh) || buffer_freed(bh))
return 0;
return ext4_journal_get_write_access(handle, bh);
/*
* __block_prepare_write() could have dirtied some buffers. Clean
* the dirty bit as jbd2_journal_get_write_access() could complain
* otherwise about fs integrity issues. Setting of the dirty bit
* by __block_prepare_write() isn't a real problem here as we clear
* the bit before releasing a page lock and thus writeback cannot
* ever write the buffer.
*/
if (dirty)
clear_buffer_dirty(bh);
ret = ext4_journal_get_write_access(handle, bh);
if (!ret && dirty)
ret = ext4_handle_dirty_metadata(handle, NULL, bh);
return ret;
}

/*
Expand Down

0 comments on commit ec558fb

Please sign in to comment.