Bug #7798
closedvfs_mountfs passes junk in flags to domount
100%
Description
... 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 Andrew Stormont over 5 years ago
Updated by Electric Monk over 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 2fc78efe68572a35081bd6d8b1deb2560619c3e6
commit 2fc78efe68572a35081bd6d8b1deb2560619c3e6 Author: Andrew Stormont <astormont@racktopsystems.com> Date: 2017-01-25T15:55:09.000Z 7798 vfs_mountfs passes junk in flags to domount Reviewed by: Alexander Pyhalov <alp@rsu.ru> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Juraj Lutter <juraj.lutter@erigones.com> Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Dan McDonald <danmcd@omniti.com>