From: Xiubo Li <xiubli@redhat.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org, jlayton@kernel.org,
vshankar@redhat.com, mchangir@redhat.com
Subject: Re: [PATCH v2 2/2] libceph: check the data length when finishes
Date: Mon, 6 Nov 2023 08:07:08 +0800 [thread overview]
Message-ID: <347a6862-c783-3f4a-38de-526d0506bcdb@redhat.com> (raw)
In-Reply-To: <CAOi1vP9pJGU4SeJntKoQYUarOc03Vn2sxqsd4H9LtGAe+dzZNg@mail.gmail.com>
On 11/3/23 20:49, Ilya Dryomov wrote:
> On Wed, Nov 1, 2023 at 1:52 AM <xiubli@redhat.com> wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> 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@redhat.com>
>> Reviewed-by: Jeff Layton <jlayton@kernel.org>
>> ---
>> 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
>
prev parent reply other threads:[~2023-11-06 0:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 0:50 [PATCH v2 0/2] libceph: sparse-read misc fixes xiubli
2023-11-01 0:50 ` [PATCH v2 1/2] libceph: save and covert sr_datalen to host-endian xiubli
2023-11-01 0:50 ` [PATCH v2 2/2] libceph: check the data length when finishes xiubli
2023-11-03 12:49 ` Ilya Dryomov
2023-11-06 0:07 ` Xiubo Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=347a6862-c783-3f4a-38de-526d0506bcdb@redhat.com \
--to=xiubli@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=mchangir@redhat.com \
--cc=vshankar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).