lkml.org 
[lkml]   [2008]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Fix unconditional write_super() call in file_fsync()
Date
This fixes file_fsync(). we need to check ->s_dirt before calling
write_super(). It became the cause of an unneeded write.

This bug was noticed by Sudhanshu Saxena.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

fs/sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/sync.c~file_fsync-fix fs/sync.c
--- linux-2.6/fs/sync.c~file_fsync-fix 2008-04-22 15:14:50.000000000 +0900
+++ linux-2.6-hirofumi/fs/sync.c 2008-04-22 15:16:58.000000000 +0900
@@ -64,7 +64,7 @@ int file_fsync(struct file *filp, struct
/* sync the superblock to buffers */
sb = inode->i_sb;
lock_super(sb);
- if (sb->s_op->write_super)
+ if (sb->s_dirt && sb->s_op->write_super)
sb->s_op->write_super(sb);
unlock_super(sb);

_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2008-04-22 14:09    [W:0.043 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site