git: d62cfe703fd1 - stable/14 - getmntpoint: Don't compare st_rdev for non-devices
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Aug 2025 19:22:12 UTC
The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d62cfe703fd1fb53bc0006b3724428a3dc8991f1 commit d62cfe703fd1fb53bc0006b3724428a3dc8991f1 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-08-17 17:07:45 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-08-27 18:49:58 +0000 getmntpoint: Don't compare st_rdev for non-devices If the mntfromname of a mountpoint is not a device (e.g. nullfs, tarfs, procfs) we shouldn't compare st_rdev, as any match will be spurious. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51945 (cherry picked from commit 8073a5137f223bb481606b15edaa5ecb93ceffcb) --- sbin/mount/getmntopts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 31987f7b0b78..fab25466425f 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -192,6 +192,7 @@ getmntpoint(const char *name) strncpy(statfsp->f_mntfromname, device, len); } if (stat(ddevname, &mntdevstat) == 0 && + S_ISCHR(mntdevstat.st_mode) && mntdevstat.st_rdev == devstat.st_rdev) return (statfsp); }