]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: don't use special DIO path for encrypted inodes
authorJeff Layton <jlayton@kernel.org>
Thu, 25 Aug 2022 13:31:19 +0000 (09:31 -0400)
committerXiubo Li <xiubli@redhat.com>
Fri, 26 Aug 2022 23:58:56 +0000 (07:58 +0800)
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.

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/file.c

index bd5e04d994ac2e88f219521c6e32d819f18bb0a6..2444854dc80521f742e92642f006e0f015d2c3d5 100644 (file)
@@ -1729,7 +1729,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)
@@ -1955,7 +1957,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