git: eca3c0515b3f - stable/14 - linprocfs: Correct sysfs /proc/<pid>/mountinfo entry

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Mon, 31 Mar 2025 17:44:13 UTC
The branch stable/14 has been updated by glebius:

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

commit eca3c0515b3f60102ba0f62b72135e6d6dcd4b75
Author:     Alex S <iwtcex@gmail.com>
AuthorDate: 2025-03-10 18:12:36 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-03-31 17:42:48 +0000

    linprocfs: Correct sysfs /proc/<pid>/mountinfo entry
    
    Technically mount source could be an arbitrary string (since it's
    effectively ignored), but it's common to repeat fs type there.
    
    (cherry picked from commit b9752d5d1cea30a39e89c83ea3aeb539581418cb)
---
 sys/compat/linprocfs/linprocfs.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 9e69c92dc014..d4f38b491471 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -448,9 +448,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
 }
 #endif /* __i386__ || __amd64__ */
 
-static const char *path_slash_sys = "/sys";
-static const char *fstype_sysfs = "sysfs";
-
 static int
 _mtab_helper(const struct pfs_node *pn, const struct statfs *sp,
     const char **mntfrom, const char **mntto, const char **fstype)
@@ -478,8 +475,7 @@ _mtab_helper(const struct pfs_node *pn, const struct statfs *sp,
 	}
 
 	if (strcmp(*fstype, "linsysfs") == 0) {
-		*mntfrom = path_slash_sys;
-		*fstype = fstype_sysfs;
+		*mntfrom = *fstype = "sysfs";
 	} else {
 		/* For Linux msdosfs is called vfat */
 		if (strcmp(*fstype, "msdosfs") == 0)