Date: Tue, 21 Feb 2023 03:44:30 GMT From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ef4e8f0cf91f - main - nfscommon: Use IS_DEFAULT_VNET() in the vnet initialization Message-ID: <202302210344.31L3iUaC039012@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4e8f0cf91f7009745d5a7a90d3bdd2d9e25780 commit ef4e8f0cf91f7009745d5a7a90d3bdd2d9e25780 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2023-02-21 03:43:37 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2023-02-21 03:43:37 +0000 nfscommon: Use IS_DEFAULT_VNET() in the vnet initialization Another oopsie. The vnet initialization function in nfs_commonport.c for initializing prison0 by testing curthread->td_ucred->cr_prison == &prison0. This is bogus and always true. Replace it with IS_DEFAULT_VNET(curvnet). MFC after: 3 months --- sys/fs/nfs/nfs_commonport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 99482069c36d..212b498e6328 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -877,7 +877,7 @@ static void nfs_vnetinit(const void *unused __unused) { - if (curthread->td_ucred->cr_prison == &prison0) + if (IS_DEFAULT_VNET(curvnet)) NFSD_VNET(nfsstatsv1_p) = &nfsstatsv1; else NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302210344.31L3iUaC039012>