Skip to content

Commit 8cff8f5

Browse files
jtlaytonidryomov
authored andcommitted
ceph: don't use special DIO path for encrypted inodes
Eventually I want to merge the synchronous and direct read codepaths, possibly via new netfs infrastructure. For now, the direct path is not crypto-enabled, so use the sync read/write paths instead. Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Xiubo Li <[email protected]> Reviewed-and-tested-by: Luís Henriques <[email protected]> Reviewed-by: Milind Changire <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 5c64737 commit 8cff8f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/ceph/file.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,9 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
17381738
ceph_cap_string(got));
17391739

17401740
if (!ceph_has_inline_data(ci)) {
1741-
if (!retry_op && (iocb->ki_flags & IOCB_DIRECT)) {
1741+
if (!retry_op &&
1742+
(iocb->ki_flags & IOCB_DIRECT) &&
1743+
!IS_ENCRYPTED(inode)) {
17421744
ret = ceph_direct_read_write(iocb, to,
17431745
NULL, NULL);
17441746
if (ret >= 0 && ret < len)
@@ -2024,7 +2026,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
20242026

20252027
/* we might need to revert back to that point */
20262028
data = *from;
2027-
if (iocb->ki_flags & IOCB_DIRECT)
2029+
if ((iocb->ki_flags & IOCB_DIRECT) && !IS_ENCRYPTED(inode))
20282030
written = ceph_direct_read_write(iocb, &data, snapc,
20292031
&prealloc_cf);
20302032
else

0 commit comments

Comments
 (0)