Summary: | ZFS: Allow 64 bit ZFS to support 32 bit ioctls (Wine) | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Damjan Jovanovic <damjan.jov> | ||||
Component: | kern | Assignee: | freebsd-fs (Nobody) <fs> | ||||
Status: | Open --- | ||||||
Severity: | Affects Some People | CC: | allanjude, grahamperrin, jrtc27 | ||||
Priority: | --- | Keywords: | needs-qa | ||||
Version: | 12.2-RELEASE | Flags: | koobs:
maintainer-feedback?
(allanjude) koobs: mfc-stable13? koobs: mfc-stable12? |
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Damjan Jovanovic
2020-11-11 06:35:59 UTC
zfs-devel@ is disused. With further tests, I see that 32 bit "zpool" and "zfs" commands go from crashing to fully working with this patch. I can successfully zpool create, zpool destroy, zpool list, zpool status, zfs list, zfs create, zfs get all, etc. Is this something that should go upstream (OpenZFS) ? (In reply to Kubilay Kocak from comment #3) That code has changed a lot in FreeBSD 13 and upstream. 32 bit "zpool list" still crashes, as per truss: 21250: openat(AT_FDCWD,"/dev/zfs",O_RDWR,00) = 5 (0x5) 21250: ioctl(3,0xc0145a04 { IORW 0x5a('Z'), 4, 20 },0xffffb338) ERR#22 'Invalid argument' where /var/log/messages has: Aug 17 02:37:31 pc kernel: len 20 vecnum: 4 sizeof (zfs_cmd_t) 4528 probably from: if (len != sizeof (zfs_iocparm_t)) { printf("len %d vecnum: %d sizeof (zfs_cmd_t) %ju\n", len, vecnum, (uintmax_t)sizeof (zfs_cmd_t)); return (EINVAL); } in sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c That has another bug in logging, as zfs_iocparm_t and zfs_cmd_t are different structs. We should be printing sizeof(zfs_iocparm_t), not sizeof(zfs_cmd_t). This bug probably doesn't affect Linux, as it uses zfs_cmd_t directly, which has the same field sizes/alignments on 32 and 64 bit already. We wrap zfs_cmd_t in our zfs_iocparm_t, and add this bug in the process. It will take me a while to test a new patch. This is wrong for anything other than X86; it's only i386 that has this stupid ABI quirk. PowerPC freebsd32 would break if you added that unconditionally, for example, as would MIPS if MFC'ed to stable branches (though not sure how well supported freebsd32 is there). This is amongst bug reports that need special attention; see <https://lists.freebsd.org/archives/freebsd-fs/2023-April/002047.html>. With last year's 12.4 as the final RELEASE from stable/12, please: * is there – realistically – anything more to do on the FreeBSD side for stable/12? (In reply to Damjan Jovanovic from comment #4) Please, what's the current situation with regard to upstream? |