diff mbox series

回覆: [PATCH v2 2/2] ceph: set the correct mask for getattr reqeust for read

Message ID SEZPR04MB6972A30D49DE51C3E898E88EB75A2@SEZPR04MB6972.apcprd04.prod.outlook.com
State Superseded
Headers show
Series 回覆: [PATCH v2 2/2] ceph: set the correct mask for getattr reqeust for read | expand

Commit Message

Frank Hsiao 蕭法宣 Feb. 26, 2024, 3:46 a.m. UTC
Tested-by: Frank Hsiao 蕭法宣 <frankhsiao@qnap.com>
diff mbox series

Patch

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2b2b07a0a61b..08c918aa403e 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2181,14 +2181,16 @@  static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
                int statret;
                struct page *page = NULL;
                loff_t i_size;
+               int mask = CEPH_STAT_CAP_SIZE;
                if (retry_op == READ_INLINE) {
                        page = __page_cache_alloc(GFP_KERNEL);
                        if (!page)
                                return -ENOMEM;
                }

-               statret = __ceph_do_getattr(inode, page,
-                                           CEPH_STAT_CAP_INLINE_DATA, !!page);
+               if (retry_op == READ_INLINE)
+                       mask = CEPH_STAT_CAP_INLINE_DATA;
+               statret = __ceph_do_getattr(inode, page, mask, !!page);
                if (statret < 0) {
                        if (page)
                                __free_page(page);
@@ -2229,7 +2231,7 @@  static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
                /* hit EOF or hole? */
                if (retry_op == CHECK_EOF && iocb->ki_pos < i_size &&
                    ret < len) {
-                       doutc(cl, "hit hole, ppos %lld < size %lld, reading more\n",
+                       doutc(cl, "may hit hole, ppos %lld < size %lld, reading more\n",
                              iocb->ki_pos, i_size);

                        read += ret;