Date: Sat, 22 Nov 2025 23:54:23 +0000 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: a36c71acb6e9 - stable/15 - nfs_commonsubs.c: Get rid of variable used as a constant Message-ID: <69224d2f.222a4.19f28453@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a36c71acb6e960c56516612fbf5e7fc1f269e845 commit a36c71acb6e960c56516612fbf5e7fc1f269e845 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2025-10-29 00:28:04 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2025-11-22 23:53:01 +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. (cherry picked from commit 73551cd6eac29a6707c802c7d7fafcb560bf5e2b) --- 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);help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69224d2f.222a4.19f28453>
