From: J. Bruce Fields Date: Wed, 3 Jun 2020 15:12:32 +0000 (-0400) Subject: nfsd: safer handling of corrupted c_type X-Git-Tag: v5.7.6~159 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=87331261b7040510689bcfd00bae85245d0c6fbe;p=users%2Fdwmw2%2Flinux.git nfsd: safer handling of corrupted c_type [ Upstream commit c25bf185e57213b54ea0d632ac04907310993433 ] This can only happen if there's a bug somewhere, so let's make it a WARN not a printk. Also, I think it's safest to ignore the corruption rather than trying to fix it by removing a cache entry. Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 0c10bfea039eb..4a258065188e1 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c @@ -469,8 +469,7 @@ found_entry: rtn = RC_REPLY; break; default: - printk(KERN_WARNING "nfsd: bad repcache type %d\n", rp->c_type); - nfsd_reply_cache_free_locked(b, rp, nn); + WARN_ONCE(1, "nfsd: bad repcache type %d\n", rp->c_type); } goto out;