[Cluster-devel] [bug report] new ->follow_link() and ->put_link() calling conventions

Andreas Gruenbacher agruenba at redhat.com
Tue Aug 31 15:01:48 UTC 2021


Hi Dan,

On Tue, Aug 31, 2021 at 12:15 PM Dan Carpenter <dan.carpenter at oracle.com> wrote:
> Hello GFS2 devs,
>
> The ancient patch 680baacbca69: "new ->follow_link() and ->put_link()
> calling conventions" from May 2, 2015, leads to the following
> Smatch static checker warning:
>
>         fs/gfs2/inode.c:1806 gfs2_get_link()
>         error: passing non negative 13 to ERR_PTR

this looks like a false positive: gh->gh_error will only be set to
GLR_TRYFAILED when try_futile is true, and try_futile will only be
true when the LM_FLAG_TRY or LM_FLAG_TRY_1CB flag in gh->gh_flags is
set. The code is a bit convoluted, and it's not surprising that smatch
doesn't understand what's going on.

Thanks,
Andreas




More information about the Cluster-devel mailing list