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
This commit is contained in:
@@ -185,6 +185,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user