vfs_mountfs passes junk in flags to domount
... which can cause filesystems to fail to mount. Possibly more of an issue when using a newer compiler, or a higher optimisation level.
A little background: we have some extra filesystems that we mount at boot and were seeing mount failures when running on real hardware (things worked fine on VMware). The cause was tracked down to the vfs_mountfs function which was passing an improperly initialised mounta struct to domount. This was then passed to zfs_mount which was returning EINVAL because the mount flags were invalid (as they were junk from the stack).
To clarify it's actually the "datalen" field which causes this check to fail when non-zero: https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/fs/zfs/zfs_vfsops.c#L1566
Updated by Electric Monk about 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit 2fc78efe68572a35081bd6d8b1deb2560619c3e6 Author: Andrew Stormont <email@example.com> Date: 2017-01-25T15:55:09.000Z 7798 vfs_mountfs passes junk in flags to domount Reviewed by: Alexander Pyhalov <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Reviewed by: Yuri Pankov <firstname.lastname@example.org> Reviewed by: Juraj Lutter <email@example.com> Reviewed by: Marcel Telka <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>