Re: [PATCH net v3 1/2] af_unix: Fix inq_len update problem in partial read
From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2026-06-01 18:35:00
Also in:
linux-mediatek, lkml
From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2026-06-01 18:35:00
Also in:
linux-mediatek, lkml
On Mon, Jun 1, 2026 at 4:37 AM [off-list ref] wrote:
From: Jianyu Li <redacted>
Currently inq_len is updated only when the whole skb is consumed.
If only part of the data is read, following SIOCINQ query would
get value greater than what actually left.
This change update inq_len timely in unix_stream_read_generic(),
and adjust unix_stream_read_skb() accordingly to prevent
repetitive update.
Fixes: f4e1fb04c123 ("af_unix: Use cached value for SOCK_STREAM in unix_inq_len().")
Signed-off-by: Jianyu Li <redacted>
---
v2: Improve lock usage in unix_stream_read_generic()For future submissions, since this patch has no change since v2, you could carry my tag from v2. Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Thanks !