Re: [PATCH] reiserfs:fix journaling issue regarding fsync()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




At 00:34 06/07/03, Hans Reiser wrote:
>Chris Mason wrote:
>
>>
>>Thanks, this one looks good.
>>
>>
>Hisashi, please submit it to akpm.

Hi, Andrew.

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@xxxxxxxxxxxxx>

diff -Nru linux-2.6.17/fs/reiserfs/file.c linux-2.6.17_fix/fs/reiserfs/file.c
--- linux-2.6.17/fs/reiserfs/file.c	2006-06-18 10:49:35.000000000 +0900
+++ linux-2.6.17_fix/fs/reiserfs/file.c	2006-07-03 09:52:51.000000000 +0900
@@ -860,8 +860,12 @@
 			// 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;
 	}

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux