Re: [PATCH 1/2] libceph: fail the sparse-read if there still has data in socket

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

 




On 12/8/23 19:31, Ilya Dryomov wrote:
On Fri, Dec 8, 2023 at 5:34 AM <xiubli@xxxxxxxxxx> wrote:
From: Xiubo Li <xiubli@xxxxxxxxxx>

Once this happens that means there have bugs.

URL: https://tracker.ceph.com/issues/63586
Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
---
  net/ceph/osd_client.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 5753036d1957..848ef19055a0 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -5912,10 +5912,12 @@ 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)
+                       if (sr->sr_datalen) {
                                 pr_warn_ratelimited("sr_datalen %u sr_index %d count %u\n",
                                                     sr->sr_datalen, sr->sr_index,
                                                     count);
+                               return -EREMOTEIO;
+                       }

                         sr->sr_state = CEPH_SPARSE_READ_HDR;
                         goto next_op;
--
2.43.0

Hi Xiubo,

There is a patch in linux-next, also from you, which is conflicting
with this one: cca19d307d35 ("libceph: check the data length when
sparse read finishes").  Do you want it replaced?

Yeah, let me fold them.

Thanks Jeff and Ilya.


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