git: ef4e8f0cf91f - main - nfscommon: Use IS_DEFAULT_VNET() in the vnet initialization
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 21 Feb 2023 03:44:30 UTC
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),