Re: [cocci] Checking evaluation of another SmPL script

Julia Lawall <[email protected]> Tue, 26 May 2026 10:27:36 +0200 (CEST)
Newsgroups fr.inria.cocci
Message-ID <[email protected]>

On Tue, 26 May 2026, Markus Elfring wrote:

> …
> >> @@ -2229,22 +2228,14 @@ lookup_again:
> >>                 dprintk("%s wait for layoutreturn\n", __func__);
> >>                 lseg = ERR_PTR(pnfs_prepare_to_retry_layoutget(lo));
> >>                 if (!IS_ERR(lseg)) {
> >> -                       pnfs_put_layout_hdr(lo);
> >>                         dprintk("%s retrying\n", __func__);
> >> -                       trace_pnfs_update_layout(ino, pos, count, iomode, lo,
> >> -                                                lseg,
> >> -                                                PNFS_UPDATE_LAYOUT_RETRY);
> >>                         goto lookup_again;
> >>                 }
> >> -               trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg,
> >> -                                        PNFS_UPDATE_LAYOUT_RETURN);
> > When you use * there s no way to go what matches with what.

Sorry, typo here: there's no way to know what matches with what

>
> How would anybody get such an information from the software documentation
> with sufficient certainty (according to usage of SmPL asterisks)?

Well, * puts a - on every line that contains a matched token.  - is a
single character and there can be multiple matches, so it seems pretty
obvious.

>
> >                                                              But this line
> > looks questionable because there isn't an obvious path from the
> > pnfs_put_layout_hdr above to the trace_pnfs_update_layout here.
>
> Will any more users of the Coccinelle software find such a view interesting?
>
>
> >                                                                  You get
> > this because of the no-gotos flag not taking the goto lookup_again;
>
> Will further clarifications become relevant also for any related program parameters
> like “--no-loops”?

--no-loops doesn't introduce non existent paths.  It only removes the
back edges in loop operators.

julia