Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Mar 2021 16:28:23 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3664067ea91a - releng/13.0 - nfsclient: fix panic in cache_enter_time()
Message-ID:  <202103031628.123GSNc2043050@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=3664067ea91a5484e0f75c9938d559ec1134a565

commit 3664067ea91a5484e0f75c9938d559ec1134a565
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2021-02-28 01:54:05 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2021-03-03 16:27:06 +0000

    nfsclient: fix panic in cache_enter_time()
    
    Juraj Lutter (otis@) reported a panic "dvp != vp not true" in
    cache_enter_time() called from the NFS client's nfsrpc_readdirplus()
    function.
    This is specific to an NFSv3 mount with the "rdirplus" mount
    option. Unlike NFSv4, NFSv3 replies to ReaddirPlus
    includes entries for the current directory.
    
    This trivial patch avoids doing a cache_enter_time()
    call for the current directory to avoid the panic.
    
    Approved by:    re (gjb)
    
    (cherry picked from commit 3fe2c68ba20fb3365ef91e0b85f88237b5369f38)
---
 sys/fs/nfsclient/nfs_clrpcops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index b4f2d5301d13..c95d4dc58e7a 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -3761,6 +3761,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 				    ndp->ni_vp = newvp;
 				    NFSCNHASH(cnp, HASHINIT);
 				    if (cnp->cn_namelen <= NCHNAMLEN &&
+					ndp->ni_dvp != ndp->ni_vp &&
 					(newvp->v_type != VDIR ||
 					 dctime.tv_sec != 0)) {
 					cache_enter_time(ndp->ni_dvp,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103031628.123GSNc2043050>