NetBSD-Bugs archive

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

kern/59783: Can't mount the "special" SGI volume formatted cd9660



>Number:         59783
>Category:       kern
>Synopsis:       Can't mount the "special" SGI volume formatted cd9660
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 22 15:45:00 +0000 2025
>Originator:     Adrian Chadd
>Release:        11.99.4
>Organization:
>Environment:
NetBSD sgimips.home.cacheboy.io 11.99.4 NetBSD 11.99.4 (GENERIC32_IP2x) #0: Fri Nov 21 21:46:20 UTC 2025  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/sgimips/compile/GENERIC32_IP2x sgimips

>Description:
The generated CD images boot fine via:

boot -f scsi(0)cdrom(5)rdisk(0)partition(8)ip2xboot

.. which means the SGI volume label is correct!

But they can't be mounted.
---
sgimips# mount -t cd9660 /dev/cd0a /mnt
mount_cd9660: /dev/cd0a on /mnt: Invalid argument
---

sgimips# svhlabel cd0

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    666376      1024     4.2BSD   1024  8192    16  # (Cyl.   1024 - 667399)
 c:    670472         0     unused      0     0        # (Cyl.      0 - 670471)
 i:      4096         0    unknown                     # (Cyl.      0 -   4095)

Not updating disk label.
sgimips# 

---
sgimips# disklabel cd0
# /dev/rcd0:
type: SCSI
disk: optical media
label: fictitious
flags: removable
bytes/sector: 2048
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 36546
total sectors: 74846208
rpm: 300
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    666376      1024     4.2BSD   1024  8192    16  # (Cyl.      0*-    325*)
 c:    670472         0    unknown                     # (Cyl.      0 -    327*)
 i:      4096         0    unknown                     # (Cyl.      0 -      1)
disklabel: partitions a and c overlap
disklabel: partitions a and i overlap
disklabel: partitions c and i overlap
---

>How-To-Repeat:
* boot
* mount -t cd9660 /dev/cd0a /mnt
* see it prints out 

---
sgimips# mount -t cd9660 /dev/cd0a /mnt
mount_cd9660: /dev/cd0a on /mnt: Invalid argument
---

* With the below diff, I instead get:

---
# mount -t cd9660 /dev/cd0a /mnt
# ls /mnt
ip2x    ip3x    sgimips
# mount
/dev/md0a on / type ffs (local)
mfs:107 on /dev type mfs (synchronous, union, local)
/dev/cd0a on /mnt type cd9660 (read-only, local)
---

>Fix:
from mlelstv on irc; I've tested this and it fixes it.

---
adrian@test-3:/data/1/adrian/netbsd/netbsd-src % git diff sys/fs/cd9660
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 6d9e443d5b30..9c2dac42b435 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -419,7 +419,8 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l,
        error = VOP_IOCTL(devvp, DIOCGDINFO, &label, FREAD, FSCRED);
        if (!error) {
                /* XXX more sanity checks? */
-               sess = label.d_partitions[DISKPART(dev)].p_cdsession;
+               if (label.d_partitions[DISKPART(dev)].p_fstype == FS_ISO9660)
+                       sess = label.d_partitions[DISKPART(dev)].p_cdsession;
        } else {
                /* fallback to old method */
                error = VOP_IOCTL(devvp, CDIOREADMSADDR, &sess, 0, FSCRED);
---



Home | Main Index | Thread Index | Old Index