diff options
author | majianpeng <majianpeng@gmail.com> | 2013-06-27 03:56:06 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-09 20:55:18 -0400 |
commit | 7ab9b3807097fcb87b0e85a9ad82b12322d9cc63 (patch) | |
tree | dfdbe4acdb1f1b7d8f83400989fe8168b9f0afa3 /fs/ceph | |
parent | 688bac461ba3e9d221a879ab40b687f5d7b5b19c (diff) |
ceph: Don't use ceph-sync-mode for synchronous-fs.
Sending reads and writes through the sync read/write paths bypasses the
page cache, which is not expected or generally a good idea. Removing
the write check is safe as there is a conditional vfs_fsync_range() later
in ceph_aio_write that already checks for the same flag (via
IS_SYNC(inode)).
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 7d4e769f1d3d..63ec830b9306 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -659,7 +659,6 @@ again: | |||
659 | 659 | ||
660 | if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 || | 660 | if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 || |
661 | (iocb->ki_filp->f_flags & O_DIRECT) || | 661 | (iocb->ki_filp->f_flags & O_DIRECT) || |
662 | (inode->i_sb->s_flags & MS_SYNCHRONOUS) || | ||
663 | (fi->flags & CEPH_F_SYNC)) | 662 | (fi->flags & CEPH_F_SYNC)) |
664 | /* hmm, this isn't really async... */ | 663 | /* hmm, this isn't really async... */ |
665 | ret = ceph_sync_read(filp, base, len, ppos, &checkeof); | 664 | ret = ceph_sync_read(filp, base, len, ppos, &checkeof); |
@@ -763,7 +762,6 @@ retry_snap: | |||
763 | 762 | ||
764 | if ((got & (CEPH_CAP_FILE_BUFFER|CEPH_CAP_FILE_LAZYIO)) == 0 || | 763 | if ((got & (CEPH_CAP_FILE_BUFFER|CEPH_CAP_FILE_LAZYIO)) == 0 || |
765 | (iocb->ki_filp->f_flags & O_DIRECT) || | 764 | (iocb->ki_filp->f_flags & O_DIRECT) || |
766 | (inode->i_sb->s_flags & MS_SYNCHRONOUS) || | ||
767 | (fi->flags & CEPH_F_SYNC)) { | 765 | (fi->flags & CEPH_F_SYNC)) { |
768 | mutex_unlock(&inode->i_mutex); | 766 | mutex_unlock(&inode->i_mutex); |
769 | written = ceph_sync_write(file, iov->iov_base, count, | 767 | written = ceph_sync_write(file, iov->iov_base, count, |