diff options
author | Jeff Layton <jlayton@kernel.org> | 2022-08-25 15:31:19 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2023-08-24 11:24:36 +0200 |
commit | 8cff8f5374c7974ab9b9726c5b7c50f10466047e (patch) | |
tree | 952fa84bbcd24998001e07c748c0608da47761a8 /fs/ceph | |
parent | ceph: add truncate size handling support for fscrypt (diff) | |
download | linux-8cff8f5374c7974ab9b9726c5b7c50f10466047e.tar.xz linux-8cff8f5374c7974ab9b9726c5b7c50f10466047e.zip |
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 <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 24ee84f257fb..f4c3da5b38fe 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1738,7 +1738,9 @@ again: ceph_cap_string(got)); if (!ceph_has_inline_data(ci)) { - if (!retry_op && (iocb->ki_flags & IOCB_DIRECT)) { + if (!retry_op && + (iocb->ki_flags & IOCB_DIRECT) && + !IS_ENCRYPTED(inode)) { ret = ceph_direct_read_write(iocb, to, NULL, NULL); if (ret >= 0 && ret < len) @@ -2024,7 +2026,7 @@ retry_snap: /* we might need to revert back to that point */ data = *from; - if (iocb->ki_flags & IOCB_DIRECT) + if ((iocb->ki_flags & IOCB_DIRECT) && !IS_ENCRYPTED(inode)) written = ceph_direct_read_write(iocb, &data, snapc, &prealloc_cf); else |