Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 2025 00:31:14 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: 73551cd6eac2 - main - nfs_commonsubs.c: Get rid of variable used as a constant
Message-ID:  <202510290031.59T0VE5B029472@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=73551cd6eac29a6707c802c7d7fafcb560bf5e2b

commit 73551cd6eac29a6707c802c7d7fafcb560bf5e2b
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2025-10-29 00:28:04 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2025-10-29 00:28:04 +0000

    nfs_commonsubs.c: Get rid of variable used as a constant
    
    The variable ncl_mbuf_mhlen is set to MHLEN and only
    used in one place.  This patch simply deletes it and
    replaces it with MHLEN.
    
    This patch should not affect semantics.
    
    Spotted while fixing cases that could do large
    NFSM_DISSECT() sizes.
    
    MFC after:      2 weeks
---
 sys/fs/nfs/nfs_commonsubs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 8e1a26eef354..f580a394a735 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -194,7 +194,6 @@ struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = {
 	{ 0, 1, 1, 1, LK_EXCLUSIVE, 1, 1 },		/* Removexattr */
 };
 
-static int ncl_mbuf_mhlen = MHLEN;
 struct nfsrv_lughash {
 	struct mtx		mtx;
 	struct nfsuserhashhead	lughead;
@@ -770,7 +769,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int how)
 		nd->nd_dpos += siz;
 	} else if (nd->nd_md->m_next == NULL) {
 		return (retp);
-	} else if (siz > ncl_mbuf_mhlen) {
+	} else if (siz > MHLEN) {
 		panic("nfs S too big");
 	} else {
 		MGET(mp2, how, MT_DATA);


home | help

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