[prev in list] [next in list] [prev in thread] [next in thread] 

List:       illumos-developer
Subject:    Re: [developer] LFR: 7144 lofiadm mounting in non-GZ under smartos 20160622
From:       "Patrick Mooney" <patrick.mooney () joyent ! com>
Date:       2016-06-28 22:06:00
Message-ID: CABtm=mrePmHq=THaAFs2BHXE229OwH8R4+vBKfwGS3bnFo9PJg () mail ! gmail ! com
[Download RAW message or body]

I tested the patch out and can confirm that it fixes the lofiadm
functionality used to build SmartOS images.

On 28 June 2016 at 11:36, Toomas Soome <tsoome@me.com> wrote:
> 
> Hi!
> 
> Please review:
> 
> RB: https://www.illumos.org/rb/r/204/
> Issue: https://www.illumos.org/issues/7144
> 
> The labeled lofi support did unintentionally break lofi default behavior is local \
> zones. 
> The native zones have default entries for lofi devices in platform.xml:
> 
> <device match="lofi" />
> <device match="rlofi" />
> 
> Those entries will grant permission to map files in local zone with lofiadm. The \
> mechanism depends on resource property "zone" set to zone name, so the dev driver \
> managing /dev namespace can create device nodes in /dev/[r]lofi directories. 
> lofi driver does set "zone" property but fails to respond properly to property \
> searches. This fix does implement two changes to resolve the issue. First the zone, \
> size and nblocks  properties are marked as DDI_DEV_T_NONE, as those properties are \
> "global" per mapping. For second, lofi_prop_op() is updated to fall back to \
> ddi_prop_op() with DDI_DEV_T_ANY device specifier, so ddi_prop_op() can search and \
> find the "global" properties. 
> Testing done:
> 
> root@lz:/root# lofiadm
> Block Device             File                           Options
> root@lz:/root# lofiadm -a test
> /dev/lofi/2
> root@lz:/root# lofiadm
> Block Device             File                           Options
> /dev/lofi/2              /root/test                     -
> root@lz:/root# zonename
> lz
> root@lz:/root#
> 
> root@test:~# more /etc/zones/lz.xml
> <?xml version="1.0"?>
> <!DOCTYPE zone PUBLIC "-//Sun Microsystems Inc//DTD Zones//EN" \
> "file:///usr/share/lib/xml/dtd/zonecfg.dtd.1"> <!--
> DO NOT EDIT THIS FILE.  Use zonecfg(1M) instead.
> -->
> <zone name="lz" zonepath="/zones/lz" autoboot="false" brand="ipkg" \
> ip-type="exclusive" fs-allowed="ufs"> <network physical="lz0"/>
> </zone>
> root@test:~#
> 
> PS:  There still is something disturbing me, lofiadm -d does clean up /dev/lofi \
> tree in global zone, but not in local zone (in GZ devfsadm does take care of it, by \
> removing symlinks). I'm not sure if this is an side effect or vtab in \
> usr/src/uts/common/fs/dev/sdev_subr.c. 
> thanks,
> toomas
> 


-------------------------------------------
illumos-developer
Archives: https://www.listbox.com/member/archive/182179/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182179/25758058-4e9228dc
Modify Your Subscription: \
https://www.listbox.com/member/?member_id=25758058&id_secret=25758058-c19b436a \
Powered by Listbox: http://www.listbox.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic