[PATCH] ceph: sync metadata when having I_DIRTY_DATASYNC flag in fdatasync

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

 



When inode marks flag I_DIRTY_DATASYNC, even if fdatasync
should sync essential metadata.

Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
---
 fs/ceph/caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 0e5bd3e..6e08abb 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2170,7 +2170,7 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync)
 	if (ret < 0)
 		goto out;
 
-	if (datasync)
+	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
 		goto out;
 
 	inode_lock(inode);
-- 
1.8.3.1

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



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux