NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/56529: mount: exec mount_ for /mnt: mount_: No such file or directory



>Number:         56529
>Category:       bin
>Synopsis:       mount: exec mount_ for /mnt: mount_: No such file or directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 01 06:35:00 +0000 2021
>Originator:     RVP
>Release:        NetBSD/amd64 9.99.92
>Organization:
>Environment:
NetBSD x202e.localdomain 9.99.92 NetBSD 9.99.92 (MYKERNEL) #0: Wed Dec  1 00:05:59 UTC 2021  bld@x202e.localdomain:/usr/obj/usr/src/sys/arch/amd64/compile/MYKERNEL amd64
>Description:
mount(8) should try FFS when ioctl(DIOCGWEDGEINFO) returns an empty
`dkw_ptype':

# dkctl wd0 listwedges | fgrep dk13
dk13: OpenBSD_6.9, 62914560 blocks at 188796928, type:
# mount -r /dev/dk13 /mnt
mount: exec mount_ for /mnt: mount_: No such file or directory
# 
>How-To-Repeat:
As above.
>Fix:
diff -urN sbin/mount.orig/mount.c sbin/mount/mount.c
--- sbin/mount.orig/mount.c	2021-11-22 21:56:16.545929587 +0000
+++ sbin/mount/mount.c	2021-11-30 06:19:06.108837606 +0000
@@ -743,7 +743,9 @@
 	if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
 		/* Yup, this is easy. */
 		(void) close(fd);
-		return (dkw.dkw_ptype);
+		if (dkw.dkw_ptype && *dkw.dkw_ptype)
+			return (dkw.dkw_ptype);
+		return NULL;
 	}
 
 	if (ioctl(fd, DIOCGDINFO, &dl) == -1) {



Home | Main Index | Thread Index | Old Index