aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index a79f9269831e..4f1dc7120916 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1382,12 +1382,11 @@ retry_snap:
1382 ceph_cap_string(got)); 1382 ceph_cap_string(got));
1383 ceph_put_cap_refs(ci, got); 1383 ceph_put_cap_refs(ci, got);
1384 1384
1385 if (written >= 0 && 1385 if (written >= 0) {
1386 ((file->f_flags & O_SYNC) || IS_SYNC(file->f_mapping->host) || 1386 if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))
1387 ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))) { 1387 iocb->ki_flags |= IOCB_DSYNC;
1388 err = vfs_fsync_range(file, pos, pos + written - 1, 1); 1388
1389 if (err < 0) 1389 written = generic_write_sync(iocb, written);
1390 written = err;
1391 } 1390 }
1392 1391
1393 goto out_unlocked; 1392 goto out_unlocked;