From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id D54475A0272 for ; Wed, 20 Mar 2024 12:04:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710932670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TjYRJJ5Ol5zSf/g4a8htseFUIYBPZ1H6qEWZ2s2y8MY=; b=XLhJCHJdPEfSs9oMaQfvWEGeZ3JdHiFfbOhkv+pwTL/SjdmrDK39bzlwZaVS5ndHfLovfc bSJW6Bft36+Vg5qwUOwllTILqUnlBx/YXjJOA8skaIxNiFzgI35BraLPrAEfZ4OWO4+byL dFesEx07SgFY+IPJ5nmc4fTUwcC7eK0= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-Sio-xXhgMUOUi3wfNP545g-1; Wed, 20 Mar 2024 07:04:29 -0400 X-MC-Unique: Sio-xXhgMUOUi3wfNP545g-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a4455ae71fcso318899566b.3 for ; Wed, 20 Mar 2024 04:04:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710932668; x=1711537468; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TjYRJJ5Ol5zSf/g4a8htseFUIYBPZ1H6qEWZ2s2y8MY=; b=resx5mHDvYf1JC33Clx3ZLQ4jl9wNiaw4IydiYK7e3/9tJqhUAdgqP5sB82JnBlXqz mdfAmoFt7HysTzk1Kb3CPfLotQ6hET/IWM2oPPkOtSp+VJkpc/H66E43KErocxTR8Gjz Msnhgkse3/C1RP5Py3GbBiLVYKdOxnrOoFpE6GYjwZK+3wsOiozooNqn8HQ1Rn/S5T7K 2Q4bD+uVzcvsxLOcARZRMEh9VnIHhhPsqcb1ldBHtlJTG0EH7hFos1541Q722I1RWiQJ rYLpvaA15fuHuDiSQzOwUwDFU4WBNZ2Z9dnQFnhsYkpi7c4hqG+SrrGggd9NKoEtaGFP i7tg== X-Gm-Message-State: AOJu0Yxp4rwgEyX5TmQKWzA05zdAmuU6BY1NLoVhovxVtetWIVhC+o6h Ril1B5VizHoDJTcn29aAhyZqm4l/FVNUUXFIMNlbsnHw+eJ8P4lAmDgpX3WFtVA5pn+yM1ZAG1c jmkVLlCWyRJpQTCQZOosx7wbCfuPKUySETqgsA3DfQT61/QMmEsW30XDH7W+a X-Received: by 2002:a17:907:111b:b0:a46:d61f:c561 with SMTP id qu27-20020a170907111b00b00a46d61fc561mr1060795ejb.27.1710932667759; Wed, 20 Mar 2024 04:04:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQGxYMttVIvd5RG9eRHXU1BAUdcVZTqbQygKMuVmXN6QRV+lDAezPBYxRTZnXXSki5TLCHzw== X-Received: by 2002:a17:907:111b:b0:a46:d61f:c561 with SMTP id qu27-20020a170907111b00b00a46d61fc561mr1060772ejb.27.1710932667093; Wed, 20 Mar 2024 04:04:27 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id e5-20020a170906504500b00a46e86c6c7esm1358169ejk.204.2024.03.20.04.04.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2024 04:04:25 -0700 (PDT) Date: Wed, 20 Mar 2024 12:03:51 +0100 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v2] util: fix confusion between offset in the iovec array and in the entry Message-ID: <20240320120351.4b9fb9b7@elisabeth> In-Reply-To: <20240320084726.1851595-1-lvivier@redhat.com> References: <20240320084726.1851595-1-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 335T5MZIZDV6OLRST3IWFCZNRTQT5BNN X-Message-ID-Hash: 335T5MZIZDV6OLRST3IWFCZNRTQT5BNN X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, david@gibson.dropbear.id.au X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 20 Mar 2024 09:47:26 +0100 Laurent Vivier wrote: > In write_remainder() 'skip' is the offset to start the operation from > in the iovec array. > > In iov_skip_bytes(), 'skip' is also the offset in the iovec array but > 'offset' is the first unskipped byte in the iovec entry. > > As write_remainder() uses 'skip' for both, 'skip' is reset to the > first unskipped byte in the iovec entry rather to staying the first > unskipped byte in the iovec array. > > Fix the problem by introducing a new variable not to overwrite 'skip' > on each loop. > > Fixes: 8bdb0883b441 ("util: Add write_remainder() helper") > Cc: david@gibson.dropbear.id.au > Signed-off-by: Laurent Vivier Applied. -- Stefano