Skip to content

Commit 73ce593

Browse files
Hisashi HifumiLinus Torvalds
authored andcommitted
[PATCH] reiserfs: fix journaling issue regarding fsync()
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>
1 parent 0808925 commit 73ce593

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎fs/reiserfs/file.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,12 @@ static int reiserfs_submit_file_region_for_write(struct reiserfs_transaction_han
860860
// this sets the proper flags for O_SYNC to trigger a commit
861861
mark_inode_dirty(inode);
862862
reiserfs_write_unlock(inode->i_sb);
863-
} else
863+
} else {
864+
reiserfs_write_lock(inode->i_sb);
865+
reiserfs_update_inode_transaction(inode);
864866
mark_inode_dirty(inode);
867+
reiserfs_write_unlock(inode->i_sb);
868+
}
865869

866870
sd_update = 1;
867871
}

0 commit comments

Comments
 (0)