]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ceph: improving efficiency of syncfs
authorChengguang Xu <cgxu519@icloud.com>
Tue, 30 Jan 2018 02:02:30 +0000 (10:02 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 30 Jan 2018 20:10:15 +0000 (21:10 +0100)
write_inode() could be called variety of reasons, in the case of syncfs(2)
there is no need to wait for flush getting completed in write_inode(),
->sync_fs is for guaranteeing flush completion for all inodes at that point.

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 8e66fb0e743d1facddc9aa8192f7222256e7b312..6582c4507e6c9d1fdf2876c13c424f0c5830495c 100644 (file)
@@ -2207,7 +2207,7 @@ int ceph_write_inode(struct inode *inode, struct writeback_control *wbc)
        u64 flush_tid;
        int err = 0;
        int dirty;
-       int wait = wbc->sync_mode == WB_SYNC_ALL;
+       int wait = (wbc->sync_mode == WB_SYNC_ALL && !wbc->for_sync);
 
        dout("write_inode %p wait=%d\n", inode, wait);
        if (wait) {