Re: [PATCH v2 2/2] libceph: check the data length when finishes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/3/23 20:49, Ilya Dryomov wrote:
On Wed, Nov 1, 2023 at 1:52 AM <xiubli@xxxxxxxxxx> wrote:
From: Xiubo Li <xiubli@xxxxxxxxxx>

For sparse reading the real length of the data should equal to the
total length from the extent array.

URL: https://tracker.ceph.com/issues/62081
Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
  net/ceph/osd_client.c | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 800a2acec069..7af35106acaf 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -5921,6 +5921,13 @@ static int osd_sparse_read(struct ceph_connection *con,
                 fallthrough;
         case CEPH_SPARSE_READ_DATA:
                 if (sr->sr_index >= count) {
+                       if (sr->sr_datalen && count) {
+                               pr_warn_ratelimited("sr_datalen %d sr_index %d count %d\n",
+                                                   sr->sr_datalen, sr->sr_index,
+                                                   count);
+                               WARN_ON_ONCE(sr->sr_datalen);
Hi Xiubo,

I don't think we need both pr_warn_ratelimited and WARN_ON_ONCE?  This
is a state machine, so the stack trace that WARN_ON_ONCE would dump is
unlikely to be of any help.

Okay, makes sense. Let me remove the WARN_ON_ONCE.

Thanks

- Xiubo

Thanks,

                 Ilya






[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux