Page MenuHomeFreeBSD

Move 32-bit compat for md(4) ioctls into the md code.
ClosedPublic

Authored by brooks on Mar 17 2018, 12:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 8:40 AM
Unknown Object (File)
Nov 10 2023, 10:40 AM
Unknown Object (File)
Oct 9 2023, 9:36 AM
Unknown Object (File)
Oct 2 2023, 6:09 PM
Unknown Object (File)
Aug 27 2023, 6:51 AM
Unknown Object (File)
Aug 13 2023, 6:11 AM
Unknown Object (File)
Jul 23 2023, 11:16 PM
Unknown Object (File)
Jul 2 2023, 7:29 AM
Subscribers

Details

Summary

This is more correct in that ioctl commands have no meaning until they
hit the handler associated with the file descriptor.

Add support for MDIOCRESIZE_32 which was missed when it was added.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem added inline comments.
sys/dev/md/md.c
1895 ↗(On Diff #40366)

It's weird to me that this was moved into what is otherwise a copy operation. I would leave it out of the macro.

This revision is now accepted and ready to land.Mar 17 2018, 2:26 AM

I agree that the move to md code is more correct since numeric ioctl value does not completely identify the operation.

OTOH, there is some desire to have compat32.ko, which so far did not resulted in any action.

sys/dev/md/md.c
148 ↗(On Diff #40366)

Is this true for e.g. arm, where int64 causes padding ?

markj added inline comments.
sys/dev/md/md.c
138 ↗(On Diff #40366)

Switch to uint*_t while here?

In D14714#309353, @kib wrote:

OTOH, there is some desire to have compat32.ko, which so far did not resulted in any action.

I think we'll need a COMPAT_FREEBSD32_SUPPORT define for a long time (likely forever) if we do that we can put this tiny bit of code under there when the time comes. We'll need at least a little bit of COMPAT_FREEBSD32_SUPPORT code here to have a fall-through to a loaded handler.

sys/dev/md/md.c
148 ↗(On Diff #40366)

Probably not. It looks like such systems would have an extra 4 bytes at the end of md_pad due to MDNPAD being missized. Do we have a document of which do? That isn't yet covered in @emaste's https://wiki.freebsd.org/EdMaste/ArchitectureSpecifics

1895 ↗(On Diff #40366)

The notion was that it's the default and soon only action in the ioctl code, but I agree it's a little odd.

sys/dev/md/md.c
148 ↗(On Diff #40366)

It is arch(7), note the sentence about alingment and arm. Still, I remember the troubles with powerpc when I twiddled with struct kqueue.

  • Prefer uint##_t per style(9).
  • Don't hide mdr.md_file_seg init in a copy macro.
  • Attempt to handle failure to set md_file_seg.
  • Zero mdr prior to initialization.
This revision now requires review to proceed.Mar 18 2018, 4:50 PM
This revision is now accepted and ready to land.Mar 18 2018, 4:58 PM
This revision was automatically updated to reflect the committed changes.