Skip to content

Commit

Permalink
ceph: Don't use ceph-sync-mode for synchronous-fs.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
majianpeng authored and Sage Weil committed Aug 10, 2013
1 parent 688bac4 commit 7ab9b38
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,

if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 ||
(iocb->ki_filp->f_flags & O_DIRECT) ||
(inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
(fi->flags & CEPH_F_SYNC))
/* hmm, this isn't really async... */
ret = ceph_sync_read(filp, base, len, ppos, &checkeof);
Expand Down Expand Up @@ -763,7 +762,6 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,

if ((got & (CEPH_CAP_FILE_BUFFER|CEPH_CAP_FILE_LAZYIO)) == 0 ||
(iocb->ki_filp->f_flags & O_DIRECT) ||
(inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
(fi->flags & CEPH_F_SYNC)) {
mutex_unlock(&inode->i_mutex);
written = ceph_sync_write(file, iov->iov_base, count,
Expand Down

0 comments on commit 7ab9b38

Please sign in to comment.