Skip to content

Commit

Permalink
[PATCH] reiserfs: fix journaling issue regarding fsync()
Browse files Browse the repository at this point in the history
When write() extends a file(i_size is increased) and fsync() is called,
change of inode must be written to journaling area through fsync().
But,currently the i_trans_id is not correctly updated when i_size is
increased.  So fsync() does not kick the journal writer.

Reiserfs_file_write() already updates the transaction when blocks are
allocated, but the case when i_size increases and new blocks are not added
is not correctly treated.

Following patch fix this bug.

Signed-off-by: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <mason@suse.com>
Cc: Hans Reiser <reiser@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hisashi Hifumi authored and Linus Torvalds committed Jul 10, 2006
1 parent 0808925 commit 73ce593
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/reiserfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,12 @@ static int reiserfs_submit_file_region_for_write(struct reiserfs_transaction_han
// this sets the proper flags for O_SYNC to trigger a commit
mark_inode_dirty(inode);
reiserfs_write_unlock(inode->i_sb);
} else
} else {
reiserfs_write_lock(inode->i_sb);
reiserfs_update_inode_transaction(inode);
mark_inode_dirty(inode);
reiserfs_write_unlock(inode->i_sb);
}

sd_update = 1;
}
Expand Down

0 comments on commit 73ce593

Please sign in to comment.