From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 0ADF15A004F for ; Thu, 27 Jun 2024 03:13:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1719450799; bh=3FUxK7fZac4sFaIIx/Sc2hF7Qa5iyacvOMrOCRv+C4g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VgXdCLy4EfQv1LeO2WnGAw3zZh2oFUJNA+AhwCaniaqAcD/KzYRI95UMf+T4TyFSt Uk1aMCgDTluc0KL9DWwm1+gQ2+g0IGcg3vtsen6jYh4O5AXfEC4XNUYHFTNiLQLM8v NQtQzBV8eCEru+XD6/qOeMct5n0wtCR6CzngEGzFOAXuvaTYXQ8kTus6Yniq7ozO5E VvRYYsLZT1dRF95GiFyFN0PtEkIckBb/DQdoReVlpkXl1fJEr1be0L/NOgjhbcjXMJ 0e5MRNa2Hl9QiiNYQkA+LyWMJHszk476t8TwdOkJ+5NONq9BATqg4DGAkpky7rk9d9 L8dRr5uIMPSfw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W8gYW3Vcyz4x7l; Thu, 27 Jun 2024 11:13:19 +1000 (AEST) Date: Thu, 27 Jun 2024 10:46:18 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 2/4] tcp_splice: Check return value of setsockopt() for SO_RCVLOWAT Message-ID: References: <20240626234536.3306466-1-sbrivio@redhat.com> <20240626234536.3306466-3-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="adE2bW4a3RQktz6b" Content-Disposition: inline In-Reply-To: <20240626234536.3306466-3-sbrivio@redhat.com> Message-ID-Hash: UHMOGJBFC64J6X5T7LZXP4SMEXRZEAZJ X-Message-ID-Hash: UHMOGJBFC64J6X5T7LZXP4SMEXRZEAZJ X-MailFrom: dgibson@gandalf.ozlabs.org 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, Matej Hrica 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: --adE2bW4a3RQktz6b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 27, 2024 at 01:45:34AM +0200, Stefano Brivio wrote: > Spotted by Coverity, harmless as we would consider that successful > and check on the socket later from the timer, but printing a debug > message in that case is definitely wise, should it ever happen. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp_splice.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) >=20 > diff --git a/tcp_splice.c b/tcp_splice.c > index 5a406c6..f2d4fc6 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -598,11 +598,16 @@ eintr: > readlen > (long)c->tcp.pipe_size / 10) { > int lowat =3D c->tcp.pipe_size / 4; > =20 > - setsockopt(conn->s[fromside], SOL_SOCKET, > - SO_RCVLOWAT, &lowat, sizeof(lowat)); > - > - conn_flag(c, conn, lowat_set_flag); > - conn_flag(c, conn, lowat_act_flag); > + if (setsockopt(conn->s[fromside], SOL_SOCKET, > + SO_RCVLOWAT, > + &lowat, sizeof(lowat))) { > + flow_trace(conn, > + "Setting SO_RCVLOWAT %i: %s", > + lowat, strerror(errno)); > + } else { > + conn_flag(c, conn, lowat_set_flag); > + conn_flag(c, conn, lowat_act_flag); > + } > } > =20 > break; --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --adE2bW4a3RQktz6b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZ8tlkACgkQzQJF27ox 2Gd/Mg/0D4Qr+MD6XlczIjPAvWUUJrMcyDFSLXBRo11iLkcjWy03xXOLxL7CnAE4 CFcxOUsPCosvcCPLYrUjmWiNfz32zyGKn/diO6TamHMcciKsMhezk0x3pSRZo5Qh g5oWQjkdtFEJikA/0tvHG38s96cL+9k/DEiCfop9jNYwwm14tnSNNZWnwn2zSqBQ Q6Mdun9F9cd+HRDduRIBVwDswKoNVH7oQjuJyC3n1C8UyinEcLXeQ4WVtEsm3ZDz JZm2MY/1GWner//popHiAFFydJdZmGoDeMK2hNseyKqcNb6O+g3TbBjCsvKJzgv6 Q5YAEHSY8VKCE55B9JezS+9IsrqH6R/n6JH23+iUHbTwZKZV+GgsI7ObJkbm/qN0 Il8PWIru3LpHNOdWfMzYOitFYtyp4UCS99DD7WSatlD3LRR7mu0PbFHZAF+ikftP khyc57fUNKZtUXr7nmYeXnP7Kx53XPl6MYMETSOZusDKC9SF/3P7jev1m5C9+YwG Jy1/c2sdgPwY8eqK3ovND6qjLtOEkO9fKsTSdgNFkGJ6MYz6a7RuuvDQ0X3J3p7t lBxiOdsHoF7pCrAA1Tkxgqxj6XfPk4zXUA7dSr+472W6a3mHp8+aBVmOabi/sW66 Hf6BGwT4dRcKju3JK+ZEygnTk+h+melgplgZ/E8zeKx016UDdg== =YTZ3 -----END PGP SIGNATURE----- --adE2bW4a3RQktz6b--