Re: [PATCH v2 1/3] smb/server: fix signing when a response uses more than one iov

Andy Shevchenko <[email protected]> Fri, 17 Jul 2026 11:03:51 +0300
Newsgroups org.kernel.vger.linux-cifs
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Fri, Jul 17, 2026 at 07:43:15AM +0800, ChenXiaoSong wrote:
> The warning is triggered only when invalid arguments are passed.

Can you elaborate? The second part is the same check as it's done in
the for-loop body. The first part checks if we ever go into that loop,
so the logic here is either we have an invalid input (we skip the loop)
or always true due to repetition of the check inside, meaning that
the loop passed without finding the match.

So, what's the point?

> 在 2026/7/17 4:24, Andy Shevchenko 写道:
> > > +	WARN_ON_ONCE(work->iov_idx < 1 ||
> > > +		     work->iov[work->iov_idx].iov_base != hdr);
> > The second part of this check is basically always true. What's the point?

-- 
With Best Regards,
Andy Shevchenko