mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
vfs: fix unconditional write_super() call in 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 <[email protected]> Cc: Al Viro <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
8f0cfa52a1
commit
762873c251
1 changed files with 1 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ int file_fsync(struct file *filp, struct dentry *dentry, int datasync)
|
|||
/* 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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue