[Bug 221067] vfs.root.mountfrom.options="ro" did not take effect for a zfs root filesystem

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jul 28 10:11:35 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221067

            Bug ID: 221067
           Summary: vfs.root.mountfrom.options="ro" did not take effect
                    for a zfs root filesystem
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: wheelcomplex at gmail.com

Created attachment 184793
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=184793&action=edit
prototype fix for reference

when using a readonly filesystem as root filesystem,
vfs.root.mountfrom.options="ro" should be the only way to tell kernel mount the
filesystem in readonly. This works for UFS but ZFS. 

Currently, during kernel mountroot, zfs_domount always try to open underlayer
device for write when try to import the pool and failed.

When kernel try to import pool by calling spa_import_rootpool(pname) in
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c, there is not
parameter to tell spa_load to open underlayer device on readonly. This is the
source of this issue.

The attachment is a prototype fix for reference. It query
vfs.root.mountfrom.options when open underlayer device to set readonly flag.

A new parameter for spa_import_rootpool meight be a better solution.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list