]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
nfsd: safer handling of corrupted c_type
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Jun 2020 15:12:32 +0000 (11:12 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
BugLink: https://bugs.launchpad.net/bugs/1885322
[ 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 <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/nfsd/nfscache.c

index 0c10bfea039eb62bd7dee1de2b553e3c28f53d43..4a258065188e10a76b8652ad9ab0490de085042c 100644 (file)
@@ -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;