Re: [PATCH net v2 2/2] af_unix: Add test for SCM_INQ on partial read
From: Jianyu Li (李健瑀)
Date: Mon Jun 01 2026 - 02:01:51 EST
On Fri, 2026-05-29 at 21:23 -0700, Kuniyuki Iwashima wrote:
> On Thu, May 28, 2026 at 4:00 AM <jianyu.li@xxxxxxxxxxxx> wrote:
> >
> > From: Jianyu Li <jianyu.li@xxxxxxxxxxxx>
> >
> > Add test to verify that when a skb is partially consumed,
> > unix_inq_len() return correct remaining byte count.
> >
> > Before:
> >
> > # RUN scm_inq.stream.partial_read ...
> > # scm_inq.c:165:partial_read:Expected remain (512) == *(int
> > *)CMSG_DATA(cmsg) (768)
> > # partial_read: Test terminated by assertion
> > # FAIL scm_inq.stream.partial_read
> > not ok 2 scm_inq.stream.partial_read
> >
> > After:
> >
> > # RUN scm_inq.stream.partial_read ...
> > # OK scm_inq.stream.partial_read
> > ok 2 scm_inq.stream.partial_read
> >
> > Signed-off-by: Jianyu Li <jianyu.li@xxxxxxxxxxxx>
> > ---
> > v2: Follow reverse xmas tree ordering in partial_read test case
> > ---
> > tools/testing/selftests/net/af_unix/scm_inq.c | 54
> > ++++++++++++++++++-
> > 1 file changed, 52 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/net/af_unix/scm_inq.c
> > b/tools/testing/selftests/net/af_unix/scm_inq.c
> > index 3a86be9bda..49cfa6ef07 100644
> > --- a/tools/testing/selftests/net/af_unix/scm_inq.c
> > +++ b/tools/testing/selftests/net/af_unix/scm_inq.c
> > @@ -8,8 +8,9 @@
> >
> > #include "kselftest_harness.h"
> >
> > -#define NR_CHUNKS 100
> > -#define MSG_LEN 256
> > +#define NR_CHUNKS 100
> > +#define MSG_LEN 256
>
> nit: please align the indentation of the above two lines
> with the line below.
>
> Sorry, I should've looked closer.
>
> > +#define NR_PARTIAL_READS 3
>
> Otherwise looks good.
>
> Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
>
> Thanks
Thanks Kuniyuki, my indent width setting was 4 so I did not notice it.
I will fix it in next patch.
Best Regards,
Jianyu