git: 8e24b25b67bb - stable/13 - nfscl: Avoid KASSERT() panic in cache_enter_time()

Rick Macklem rmacklem at FreeBSD.org
Sun Jul 25 21:48:48 UTC 2021


The branch stable/13 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=8e24b25b67bb664168e3daf41d7b2262f5b136d5

commit 8e24b25b67bb664168e3daf41d7b2262f5b136d5
Author:     Rick Macklem <rmacklem at FreeBSD.org>
AuthorDate: 2021-07-14 20:33:37 +0000
Commit:     Rick Macklem <rmacklem at FreeBSD.org>
CommitDate: 2021-07-25 21:45:05 +0000

    nfscl: Avoid KASSERT() panic in cache_enter_time()
    
    Commit 844aa31c6d87 added cache_enter_time_flags(), specifically
    so that the NFS client could specify that cache enter replace
    any stale entry for the same name.  Doing so avoids a KASSERT()
    panic() in cache_enter_time(), as reported by the PR.
    
    This patch uses cache_enter_time_flags() for Readdirplus, to
    avoid the panic(), since it is impossible for the NFS client
    to know if another client (or a local process on the NFS server)
    has replaced a file with another file of the same name.
    
    This patch only affects NFS mounts that use the "rdirplus"
    mount option.
    
    There may be other places in the NFS client where this needs
    to be done, but no panic() has been observed during testing.
    
    PR:     257043
    
    (cherry picked from commit 7f5508fe78d17af968fe67e00ffa7c975aa2c67d)
---
 sys/fs/nfsclient/nfs_clrpcops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index d74b2dedaa23..8979a4d08243 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -3762,11 +3762,11 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 					ndp->ni_dvp != ndp->ni_vp &&
 					(newvp->v_type != VDIR ||
 					 dctime.tv_sec != 0)) {
-					cache_enter_time(ndp->ni_dvp,
+					cache_enter_time_flags(ndp->ni_dvp,
 					    ndp->ni_vp, cnp,
 					    &nfsva.na_ctime,
 					    newvp->v_type != VDIR ? NULL :
-					    &dctime);
+					    &dctime, VFS_CACHE_DROPOLD);
 				    }
 				    if (unlocknewvp)
 					vput(newvp);


More information about the dev-commits-src-all mailing list