Actions
Bug #3348
closedPanic when trying to mount_hammer2 a file
Description
Dragonfly 6.4.0.
Observed behavior: when I create a HAMMER2 file system on a regular file and try to mount it, I get a panic.
Expected behavior: Maybe the program should exit with an error message? I suspect I'm not supposed to do this kind of thing: the man page of mount_hammer2 says the file should be special.
To reproduce, as root:
truncate -s 1G hammer2.img
newfs_hammer2 hammer2.img
mkdir mnt
mount_hammer2 ~/hammer2.img mnt
This is the output after the last command:
hammer2_mount: devstr="/root/hammer2.img@DATA" hammer2_mount: device="/root/hammer2.img" label="DATA" rdonly=0 panic: assertion "strncmp(path, "/dev/", 5) == 0" failed in hammer2_init_devvp a t /usr/src/sys/vfs/hammer2/hammer2_ondisk.c:197 cpuid = 0 Trace beginning at frame 0xfffff800a9bbac18 hammer2_init_devvp() at hammer2_init_devvp+0x48b 0xffffffff8098589b hammer2_init_devvp() at hammer2_init_devvp+0x48b 0xffffffff8098589b hammer2_vfs_mount() at hammer2_vfs_mount+0x379 0xffffffff8096a4d9 sys_mount() at sys_mount+0x33b 0xffffffff80702d7b syscall2() at syscall2+0x11e 0xffffffff80bdc0ae Debugger("panic") CPU0 stopping CPUs: 0x00000000 stopped Stopped at Debugger+0x7c: movb $0,0xbcbd09(%rip) db>
Updated by liweitianux 17 days ago
- Category set to VFS subsystem
- Status changed from New to Resolved
- Assignee set to tkusumi
- % Done changed from 0 to 100
This KKASSERT panic has been resolved in commit 8fd12ec463befacc05099d651f1acfd4ef17a4e5 by tkusumi in 2023.
I also cherry-picked this fix to 6.4 branch.
The new output looks like:
# mount_hammer2 ./hammer2.img /mnt mount_hammer2: /dev/./hammer2.img@DATA not found
With dmesg showed messages:
hammer2_mount: devstr="/dev/./hammer2.img@DATA" hammer2_mount: device="/dev/./hammer2.img" label="DATA" rdonly=0 hammer2_ondisk: failed to nlookup /dev/./hammer2.img 2 hammer2_ondisk: failed to lookup /dev/./hammer2.img 2 hammer2: failed to initialize devvp in /dev/./hammer2.img
Actions