False positive due to MACROs in nfsd code

Harshit Mogalapalli <[email protected]> Mon, 5 Aug 2024 11:51:01 +0530
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
Hi,


fs/nfsd/nfs4xdr.c:639 nfsd4_decode_close() warn: ignoring unreachable code.



  630 static __be32
  631 nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct 
nfsd4_close *close)
  632 {
  633         DECODE_HEAD;
  634
  635         READ_BUF(4);
  636         close->cl_seqid = be32_to_cpup(p++);
  637         return nfsd4_decode_stateid(argp, &close->cl_stateid);
  638
  639         DECODE_TAIL;
  640 }

  131 /* READ_BUF, read_buf(): nbytes must be <= PAGE_SIZE */
  132 #define READ_BUF(nbytes)  do {                  \
  133         if (nbytes <= (u32)((char *)argp->end - (char *)argp->p)) 
{     \
  134                 p = argp->p;                    \
  135                 argp->p += XDR_QUADLEN(nbytes); \
  136         } else if (!(p = read_buf(argp, nbytes))) { \
  137                 dprintk("NFSD: xdr error (%s:%d)\n", \
  138                                 __FILE__, __LINE__); \
  139                 goto xdr_error;                 \
  140         }                                       \
  141 } while (0)
  142


Thought: I think we should tell mark all macro content to do inlining ? 
so it could see the goto xdr_error, I don't really know how smatch reads it


Thanks,
Harshit