On Fri, 16 November 2007 11:47:27 +0900, Hisashi Hifumi wrote:This is wrong. If I_DIRTY_DATASYNC is set, the inode needs to be written even for datasync. How about the patch below? Jörn -- Audacity augments courage; hesitation, fear. -- Publilius Syrus Signed-off-by: Jörn Engel <joern@logfs.org> --- fs/ext3/fsync.c | 3 ++- fs/ext4/fsync.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) --- git_I_DIRTY/fs/ext3/fsync.c~ext3_datasync 2007-11-15 20:51:54.000000000 +0100 +++ git_I_DIRTY/fs/ext3/fsync.c 2007-11-16 04:42:28.000000000 +0100 @@ -76,7 +76,8 @@ int ext3_sync_file(struct file * file, s * The VFS has written the file data. If the inode is unaltered * then we need not start a commit. */ - if (inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC)) { + if (((inode->i_state & I_DIRTY_SYNC) && !datasync) + || (inode->i_state & I_DIRTY_DATASYNC)) { struct writeback_control wbc = { .sync_mode = WB_SYNC_ALL, .nr_to_write = 0, /* sys_fsync did this */ --- git_I_DIRTY/fs/ext4/fsync.c~ext3_datasync 2007-11-15 20:51:54.000000000 +0100 +++ git_I_DIRTY/fs/ext4/fsync.c 2007-11-16 04:44:29.000000000 +0100 @@ -76,7 +76,8 @@ int ext4_sync_file(struct file * file, s * The VFS has written the file data. If the inode is unaltered * then we need not start a commit. */ - if (inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC)) { + if (((inode->i_state & I_DIRTY_SYNC) && !datasync) + || (inode->i_state & I_DIRTY_DATASYNC)) { struct writeback_control wbc = { .sync_mode = WB_SYNC_ALL, .nr_to_write = 0, /* sys_fsync did this */ - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Natalie Protasevich | [BUG] New Kernel Bugs |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Patrick McHardy | [NET_SCHED 00/04]: External SFQ classifiers/flow classifier |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
