Skip to content

Commit

Permalink
NFSD: Remove a never-true comparison
Browse files Browse the repository at this point in the history
fh_size is an unsigned int, thus it can never be less than 0.

Fixes: d8b2607 ("NFSD: simplify struct nfsfh")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Chuck Lever committed Nov 19, 2024
1 parent d08bf5e commit da4f777
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfsfh.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ char * SVCFH_fmt(struct svc_fh *fhp)
struct knfsd_fh *fh = &fhp->fh_handle;
static char buf[2+1+1+64*3+1];

if (fh->fh_size < 0 || fh->fh_size> 64)
if (fh->fh_size > 64)
return "bad-fh";
sprintf(buf, "%d: %*ph", fh->fh_size, fh->fh_size, fh->fh_raw);
return buf;
Expand Down

0 comments on commit da4f777

Please sign in to comment.