From darrenm@sac.sfbay.sun.com Tue Apr 29 07:39:34 2008
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TEdYA0006171
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 07:39:34 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m3TEdWjS004234;
	Tue, 29 Apr 2008 07:39:33 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300C0LCPXEU00@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 08:39:33 -0600 (MDT)
Received: from dm-sfbay-01.sfbay.sun.com ([129.145.155.118])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300M30CPWB4A0@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 08:39:32 -0600 (MDT)
Received: from sac.sfbay.sun.com (new-sac.SFBay.Sun.COM [129.146.175.65])
	by dm-sfbay-01.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id m3TEdUNi062144; Tue, 29 Apr 2008 07:39:30 -0700 (PDT)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TEdT3b006166; Tue,
 29 Apr 2008 07:39:29 -0700 (PDT)
Received: (from darrenm@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id m3TEdSG0006162; Tue,
 29 Apr 2008 07:39:28 -0700 (PDT)
Date: Tue, 29 Apr 2008 07:39:28 -0700 (PDT)
From: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Subject: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
To: PSARC-ext@sun.com
Cc: John.Levon@sun.com
Message-id: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 7773


Template Version: @(#)sac_nextcase 1.66 04/17/08 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 lofi mount
    1.2. Name of Document Author/Supplier:
	 Author:  John Levon
    1.3  Date of This Document:
	29 April, 2008
4. Technical Description
1.  Introduction

    A long-standing RFE has been for direct support of loopback file
    mounts in the mount(1m) utility. This case defines such a feature.

    A patch binding is requested.

2.  Discussion

    On Solaris today, mounting a file system image is a two stage
    process:

	lofiadm -a /path/to/my.iso
	mount -F hsfs /dev/lofi/1 /mnt/myiso

    The same applies for the unmount process. Instead, it should be a
    single operation:

	mount -F hsfs /path/to/my.iso /mnt/myiso

    Internally, this will create a lofi minor node for the file and
    mount the filesystem from that node. Unmount will remove the lofi
    node again.

    When such a system is mounted, the user will see it listed in mount as
    usual:

	$ mount -v
	...
	/lomount/1 on /lomount/ufs.good
read/write/nosetuid/nodevices/intr/largefiles/logging/xattr/onerror=panic/dev=2400001
on Fri Apr 25 07:08:17 2008


    Such entries may be placed in /etc/vfstab.

    In terms of permissions, PRIV_SYS_MOUNT is required, plus the
    ability to access the underlying file RO or RW, as needed.  No
    explicit permission to use lofi is needed.

    Such mounts are always forced as 'nosuid' (no setuid and no
    devices).

    Unlike lofiadm, a lofi mount of an existing block or character
    device is not supported.

    On some operating systems such as Linux, this feature requires an
    option "loop". This will not be necessary on Solaris, but in the
    interests of approachability, it will be silently ignored. The
    ability to explicitly specify the backing loop device is neither
    present nor needed.

    Zones do not support lofi(7d). This case doesn't change that.

    There is an interaction with lofi(7d) crypto support.  Currently,
    this case does not propose to extend mount(1m) options to include
    the ones needed for crypto support.  This may happen in the future.

    Compressed lofi(7d) support just works.

3.  VFS interface

    This feature requires explicit filesystem support in the relevant
    VFS_MOUNT() routine.
    
    In particular, a filesystem can call the following helper:

	int vfs_get_lofi(vfs_t *, vnode_t **);

    This returns the vnode for a lofi minor node corresponding to the
    mounted file. A filesystem would then use this vnode as the device
    to actually mount.

    For this to work, such a filesystem needs to skip the block device
    security check for the lofi node, as it could fail. However, the
    VOP_ACCESS() check on the mount source (which is a file for the lofi
    case) is still needed to ensure that the mount is secure.

    For example, a process with PRIV_SYS_MOUNT and
    PRIV_FILE_DAC_READ/WRITE would fail an explicit check to open the
    lofi node, but succeed in the mount source check (unless the file is
    root-owned, preserving standard semantics for least privilege).

    Currently, filesystem support exists for ufs, pcfs, hsfs, and udfs.
    ZFS support is unlikely to happen as it doesn't support traditional
    mounting in this manner.

    No change in behaviour should occur in filesystems that don't
    support this feature.

4.  lofi changes

    When unmounting such a mount, we need to take down the created lofi
    node. However, it may be held open. Rather than forcing removal of
    the node via ->li_force, we add a new option, ->li_cleanup. This
    only removes the lofi node when the last user closes it.

5.  Interface table

    lofi_ioctl				Consolidation private, used and extended
					by this project
    New mount(1m) syntax.		Committed.

6.  References

	PSARC 1999/463 lofi - fast-track
	PSARC 2007/001 lofi(7d) crypto support
	6384817 Need persistant lofi based mounts and direct mount(1m) support
for lofi

7.  Manual page differences

--- mount.man	Mon Apr 28 06:57:24 2008
+++ mount.new	Mon Apr 28 06:55:53 2008
@@ -20,7 +20,6 @@
      mount [-F FSType] [generic_options] [-o specific_options]
          [-O] special mount_point
 
-
      mount -a [-F FSType] [-V] [current_options]
          [-o specific_options] [mount_point]...
 
@@ -83,10 +82,16 @@
      /etc/dfs/fstypes file. After filling in  missing  arguments,
      mount will invoke the FSType-specific mount module.
 
+     For file system types which support it, a file can be mounted
+     directly as a file system by specifying the full path to the
+     file as the special argument.  If specific file-system support
+     for such loopback file mounts is not present, lofiadm(1M) can
+     still be used by hand to mount a file-system image.
 
-     Only a super-user can mount or unmount  file  systems  using
-     mount  and  umount.  However, any user can use mount to list
-     mounted file systems and resources.
+     Only a user with sufficient privilege (at least PRIV_SYS_MOUNT)
+     can mount or unmount  file  systems  using mount  and  umount.
+     However, any user can use mount to list mounted file systems
+     and resources.
 
 OPTIONS
      -F FSType
@@ -224,7 +229,10 @@
                  for files within the file system.   The  default
                  is exec.
 
+             loop
 
+		 Ignored for compatibility.
+
              nbmand | nonbmand
 
                  Allow or disallow non-blocking mandatory locking
@@ -411,9 +419,10 @@
 SEE ALSO
      mount_cachefs(1M),      mount_hsfs(1M),       mount_nfs(1M),
      mount_pcfs(1M),        mount_tmpfs(1M),       mount_ufs(1M),
+     mount_udfs(1M),
      mountall(1M), umountall(1M), fcntl(2),  mmap(2),  mnttab(4),
      vfstab(4),    attributes(   5),   largefile(5),   lofs(7FS),
-     pcfs(7FS)
+     pcfs(7FS), privileges(5), lofiadm(1M)
 
 NOTES
      If the directory on which a file system is to be mounted  is
--- mount_hsfs.man	Mon Apr 28 06:57:45 2008
+++ mount_hsfs.new	Mon Apr 28 06:55:09 2008
@@ -32,6 +32,7 @@
      the    missing    arguments,    including    the     FSType-
      specific_options; see mount(1M) for more details.
 
+     hsfs supports loopback file mounts: see mount(1M).
 
      A file system conforming to ISO 9660 can contain  extensions
      that  allow  it  to overcome limitations of the original ISO
--- mount_pcfs.man	Mon Apr 28 06:57:49 2008
+++ mount_pcfs.new	Mon Apr 28 06:56:16 2008
@@ -24,6 +24,7 @@
      mount  operation,  these are hidden until the file system is
      unmounted.
 
+     pcfs supports loopback file mounts: see mount(1M).
 
      If mount is invoked with special or mount_point as the  only
      arguments,  mount  will  search  /etc/vfstab  to fill in the
--- mount_udfs.man	Mon Apr 28 06:57:52 2008
+++ mount_udfs.new	Mon Apr 28 06:56:32 2008
@@ -22,6 +22,7 @@
      mount  operation,  these are hidden until the file system is
      unmounted.
 
+     udfs supports loopback file mounts: see mount(1M).
 
      If mount is invoked with either special  or  mount_point  as
      the  only  arguments,  mount searches /etc/vfstab to fill in
--- mount_ufs.man	Mon Apr 28 06:57:57 2008
+++ mount_ufs.new	Mon Apr 28 06:56:42 2008
@@ -22,6 +22,7 @@
      mount  operation,  these are hidden until the file system is
      unmounted.
 
+     ufs supports loopback file mounts: see mount(1M).
 
      If mount is invoked with special or mount_point as the  only
      arguments,  mount  will  search  /etc/vfstab  to fill in the


6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From gdamore@sun.com Tue Apr 29 07:57:33 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TEvWrS006841
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 07:57:32 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TEvNIY018674;
	Tue, 29 Apr 2008 15:57:31 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300603DJS4000@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 07:57:28 -0700 (PDT)
Received: from sca-es-mail-1.sun.com ([192.18.43.132])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K030054LDJSD7D0@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 07:57:28 -0700 (PDT)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TEvSNF026165;
 Tue, 29 Apr 2008 07:57:28 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300301DGY2I00@fe-sfbay-09.sun.com> (original mail from gdamore@sun.com)
 ; Tue, 29 Apr 2008 07:57:28 -0700 (PDT)
Received: from [192.168.251.106] ([76.174.83.55])
 by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb
 28 2007)) with ESMTPSA id <0K0300HEMDJNK5C0@fe-sfbay-09.sun.com>; Tue,
 29 Apr 2008 07:57:23 -0700 (PDT)
Date: Tue, 29 Apr 2008 07:52:12 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
Sender: Garrett.Damore@sun.com
To: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, john.levon@sun.com
Message-id: <4817361C.3040409@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071023)
Status: RO
Content-Length: 1841

Darren J Moffat wrote:
>
>     Zones do not support lofi(7d). This case doesn't change that.
>   

Is there any fundamental reason why zones can't support lofi at some 
point in the future.  I can see this being useful to zone administrators 
(though presumably they would only be able to lofi mount portions of the 
filesystem they could already access.)

>
> 3.  VFS interface
>
>     This feature requires explicit filesystem support in the relevant
>     VFS_MOUNT() routine.
>     
>     In particular, a filesystem can call the following helper:
>
> 	int vfs_get_lofi(vfs_t *, vnode_t **);
>
>     This returns the vnode for a lofi minor node corresponding to the
>     mounted file. A filesystem would then use this vnode as the device
>     to actually mount.
>
>     For this to work, such a filesystem needs to skip the block device
>     security check for the lofi node, as it could fail. However, the
>     VOP_ACCESS() check on the mount source (which is a file for the lofi
>     case) is still needed to ensure that the mount is secure.
>
>     For example, a process with PRIV_SYS_MOUNT and
>     PRIV_FILE_DAC_READ/WRITE would fail an explicit check to open the
>     lofi node, but succeed in the mount source check (unless the file is
>     root-owned, preserving standard semantics for least privilege).
>
>     Currently, filesystem support exists for ufs, pcfs, hsfs, and udfs.
>     ZFS support is unlikely to happen as it doesn't support traditional
>     mounting in this manner.
>   

Hmmm... I didn't realize that ZFS doesn't support lofi.  That seems like 
a fairly severe shortcoming, particularly given the push towards ZFS 
root.  (On a system with ZFS root, its likely there won't be *any* ufs, 
etc. filesystems.)

Are there any plans afoot that you're aware of to address this shortcoming?

    -- Garrett

From Andrew.Gabriel@sun.com Tue Apr 29 08:07:48 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TF7mH1007299
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 08:07:48 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m3TF7kn1036372;
	Tue, 29 Apr 2008 09:07:46 -0600 (MDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300E03E0XD100@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 09:07:45 -0600 (MDT)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300MPTE0UB5B0@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 09:07:43 -0600 (MDT)
Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe3.eu.sun.com [192.18.6.12])
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TF7gbZ006496; Tue,
 29 Apr 2008 15:07:42 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300M01DDQ2R00@fe-emea-09.sun.com>
 (original mail from Andrew.Gabriel@Sun.COM); Tue,
 29 Apr 2008 16:07:42 +0100 (BST)
Received: from [192.9.200.17] ([81.187.162.106])
 by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28
 2007)) with ESMTPSA id <0K03005T5E0LY760@fe-emea-09.sun.com>; Tue,
 29 Apr 2008 16:07:34 +0100 (BST)
Date: Tue, 29 Apr 2008 16:10:17 +0100
From: Andrew Gabriel <Andrew.Gabriel@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
Sender: Andrew.Gabriel@sun.com
To: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, john.levon@sun.com
Message-id: <48173A59.7070405@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071105)
Status: RO
Content-Length: 1164

Darren J Moffat wrote:
> Template Version: @(#)sac_nextcase 1.66 04/17/08 SMI
> This information is Copyright 2008 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 lofi mount
>     1.2. Name of Document Author/Supplier:
> 	 Author:  John Levon
>     1.3  Date of This Document:
> 	29 April, 2008
> 4. Technical Description
> 1.  Introduction
> 
>     A long-standing RFE has been for direct support of loopback file
>     mounts in the mount(1m) utility. This case defines such a feature.
> 
>     A patch binding is requested.

Thanks for this -- I'm certainly someone who's want it.

A couple of questions...

Will the old 2 stage method using lofiadm(1M) still work unchanged?

Prior to lofi/lofiadm, there was the fbk driver by Jörg Schilling
which was used to mount an image from a file. This provided a one
stage mount which could be included in /etc/vfstab. Just wondering
if the team looked to see how that worked in case it might be
useful? (My memory of it is now very hazy, but I think it used the
backfsmount trick which was also used by cachefs.) It might be that
it did what you are now proposing anyway.

-- 
Andrew

From Darren.Moffat@Sun.COM Tue Apr 29 08:10:00 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TF9xes007526
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 29 Apr 2008 08:10:00 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m3TF9ste002308;
	Tue, 29 Apr 2008 23:09:57 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300E0FE4FH900@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 09:09:51 -0600 (MDT)
Received: from gmp-eb-inf-1.sun.com ([192.18.6.21])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300MT2E4EBKC0@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 09:09:51 -0600 (MDT)
Received: from fe-emea-10.sun.com (gmp-eb-lb-2-fe2.eu.sun.com [192.18.6.11])
	by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TF9nMi021833; Tue,
 29 Apr 2008 15:09:49 +0000 (GMT)
Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300B01C079800@fe-emea-10.sun.com>
 (original mail from Darren.Moffat@Sun.COM); Tue,
 29 Apr 2008 16:09:49 +0100 (BST)
Received: from [129.156.173.199] by fe-emea-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0K0300L8SE481L10@fe-emea-10.sun.com>; Tue,
 29 Apr 2008 16:09:44 +0100 (BST)
Date: Tue, 29 Apr 2008 16:09:44 +0100
From: Darren J Moffat <Darren.Moffat@Sun.COM>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <4817361C.3040409@sun.com>
Sender: Darren.Moffat@Sun.COM
To: "Garrett D'Amore" <gdamore@Sun.COM>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@Sun.COM,
        john.levon@Sun.COM
Message-id: <48173A38.2090509@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080408)
Status: RO
Content-Length: 546

Garrett D'Amore wrote:
> Darren J Moffat wrote:
>>
>>     Zones do not support lofi(7d). This case doesn't change that.
>>   
> 
> Is there any fundamental reason why zones can't support lofi at some 
> point in the future.  I can see this being useful to zone administrators 
> (though presumably they would only be able to lofi mount portions of the 
> filesystem they could already access.)

Interesting but not this case.

Please ask this on the zones-discuss@opensolaris.org alias after reading 
the Zones FAQ document.

-- 
Darren J Moffat

From ceri@submonkey.net Tue Apr 29 08:14:11 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TFEALk007636
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 08:14:11 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TFE2PA027080
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 29 Apr 2008 16:14:10 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K030060FEBKLX00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 29 Apr 2008 08:14:08 -0700 (PDT)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K03006FIEBJ9310@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 29 Apr 2008 08:14:07 -0700 (PDT)
Received: from relay12i.sun.com
 (ip122.net129179-4.block1.us.syntegra.com [129.179.4.122])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TFE3w5003064	for
 <PSARC-ext@sun.com>; Tue, 29 Apr 2008 15:14:07 +0000 (GMT)
Received: from mmp14es.sun.com ([160.41.209.24] [160.41.209.24])
 by relay12i.sun.com with ESMTP id BT-MMP-390026 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 15:14:02 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp14es.sun.com with ESMTP id BT-MMP-11279 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 15:14:02 +0000 (Z)
Received: from shrike.submonkey.net ([81.106.128.65] [81.106.128.65])
 by relay1i.sun.com with ESMTP id BT-MMP-557183 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 15:14:02 +0000 (Z)
Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD))
	(envelope-from <ceri@submonkey.net>)	id 1JqrWo-0006FE-L5; Tue,
 29 Apr 2008 16:13:58 +0100
Date: Tue, 29 Apr 2008 16:13:58 +0100
From: Ceri Davies <ceri@submonkey.net>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <4817361C.3040409@sun.com>
Sender: Ceri Davies <ceri@submonkey.net>
To: "Garrett D'Amore" <gdamore@sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080429151358.GA13183@submonkey.net>
MIME-version: 1.0
Content-type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary=pf9I7BMVVzbSWLtt
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-PGP: finger ceri@FreeBSD.org
X-Antispam: No, score=-2.6/5.0, scanned in 0.080sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
Status: RO
Content-Length: 2852


--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 29, 2008 at 07:52:12AM -0700, Garrett D'Amore wrote:
> Darren J Moffat wrote:
> >
> >     Zones do not support lofi(7d). This case doesn't change that.
> >  =20
>=20
> Is there any fundamental reason why zones can't support lofi at some=20
> point in the future.  I can see this being useful to zone administrators=
=20
> (though presumably they would only be able to lofi mount portions of the=
=20
> filesystem they could already access.)
>=20
> >
> > 3.  VFS interface
> >
> >     This feature requires explicit filesystem support in the relevant
> >     VFS_MOUNT() routine.
> >    =20
> >     In particular, a filesystem can call the following helper:
> >
> > 	int vfs_get_lofi(vfs_t *, vnode_t **);
> >
> >     This returns the vnode for a lofi minor node corresponding to the
> >     mounted file. A filesystem would then use this vnode as the device
> >     to actually mount.
> >
> >     For this to work, such a filesystem needs to skip the block device
> >     security check for the lofi node, as it could fail. However, the
> >     VOP_ACCESS() check on the mount source (which is a file for the lofi
> >     case) is still needed to ensure that the mount is secure.
> >
> >     For example, a process with PRIV_SYS_MOUNT and
> >     PRIV_FILE_DAC_READ/WRITE would fail an explicit check to open the
> >     lofi node, but succeed in the mount source check (unless the file is
> >     root-owned, preserving standard semantics for least privilege).
> >
> >     Currently, filesystem support exists for ufs, pcfs, hsfs, and udfs.
> >     ZFS support is unlikely to happen as it doesn't support traditional
> >     mounting in this manner.
> >  =20
>=20
> Hmmm... I didn't realize that ZFS doesn't support lofi.  That seems like=
=20
> a fairly severe shortcoming, particularly given the push towards ZFS=20
> root.  (On a system with ZFS root, its likely there won't be *any* ufs,=
=20
> etc. filesystems.)
>=20
> Are there any plans afoot that you're aware of to address this shortcomin=
g?

I don't think that sentence means what you think it means.  You can
certainly create a lofi device backed by a file on a ZFS filesystem.
In fact, since you can also create a zpool on a lofi device, I think it
just means that you can't put a ZFS/lofi combination in vfstab.

Ceri
--=20
That must be wonderful!  I don't understand it at all.
                                                  -- Moliere

--pf9I7BMVVzbSWLtt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFIFzs2ocfcwTS3JF8RAnCvAJ9sgWV80NycwRVcGQbrv2BaKGBbowCfZOXE
Zt6ZMVkbgDMrkcs4AJdV07Y=
=cOmv
-----END PGP SIGNATURE-----

--pf9I7BMVVzbSWLtt--

From johnlev@barman.uk.sun.com Tue Apr 29 08:14:52 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TFEp6U007657
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 08:14:52 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TFEeZm027416
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 29 Apr 2008 16:14:51 +0100 (BST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300E4NECOS200@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 29 Apr 2008 09:14:48 -0600 (MDT)
Received: from dm-uk-02.uk.sun.com ([129.156.101.196])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300M1AECMBKD0@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 29 Apr 2008 09:14:47 -0600 (MDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-02.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m3TFEi5N014124; Tue, 29 Apr 2008 16:14:44 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1JqrXt-0006Vj-CW; Tue, 29 Apr 2008 16:15:05 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Tue, 29 Apr 2008 16:15:05 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <48173A59.7070405@sun.com>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Andrew Gabriel <Andrew.Gabriel@sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080429151505.GA24481@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <48173A59.7070405@sun.com>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 825

On Tue, Apr 29, 2008 at 04:10:17PM +0100, Andrew Gabriel wrote:

> >    A long-standing RFE has been for direct support of loopback file
> >    mounts in the mount(1m) utility. This case defines such a feature.
> >
> >    A patch binding is requested.
> 
> Will the old 2 stage method using lofiadm(1M) still work unchanged?

Yes.

> Prior to lofi/lofiadm, there was the fbk driver by J?rg Schilling
> which was used to mount an image from a file. This provided a one
> stage mount which could be included in /etc/vfstab. Just wondering
> if the team looked to see how that worked in case it might be
> useful? (My memory of it is now very hazy, but I think it used the
> backfsmount trick which was also used by cachefs.) It might be that
> it did what you are now proposing anyway.

I haven't looked at this.

regards
john

From johnlev@barman.uk.sun.com Tue Apr 29 08:21:42 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TFLfaE007823
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 29 Apr 2008 08:21:42 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m3TFLYF6006423;
	Tue, 29 Apr 2008 23:21:39 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300603EO1VO00@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 08:21:37 -0700 (PDT)
Received: from dm-uk-02.uk.sun.com ([129.156.101.196])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K03006WUEO09010@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 08:21:37 -0700 (PDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-02.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m3TFLXku015545; Tue, 29 Apr 2008 16:21:33 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1JqreV-0006Z4-1J; Tue, 29 Apr 2008 16:21:55 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Tue, 29 Apr 2008 16:21:54 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429151358.GA13183@submonkey.net>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Ceri Davies <ceri@submonkey.net>
Cc: "Garrett D'Amore" <gdamore@sun.com>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080429152154.GB24481@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 1291

On Tue, Apr 29, 2008 at 04:13:58PM +0100, Ceri Davies wrote:

> > Hmmm... I didn't realize that ZFS doesn't support lofi.  That seems like 
> > a fairly severe shortcoming, particularly given the push towards ZFS 
> > root.  (On a system with ZFS root, its likely there won't be *any* ufs, 
> > etc. filesystems.)
> > 
> > Are there any plans afoot that you're aware of to address this shortcoming?
> 
> I don't think that sentence means what you think it means.  You can
> certainly create a lofi device backed by a file on a ZFS filesystem.
> In fact, since you can also create a zpool on a lofi device, I think it
> just means that you can't put a ZFS/lofi combination in vfstab.

Or mount a file directly. It's not a shortcoming as such, it just works
differently. That is, the nearest ZFS equivalent of this is:

thewhip:/ # zpool import -d /var/tmp 
  pool: mypool
    id: 5292688193707361217
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

        mypool                 ONLINE
          /var/tmp/mypool.img  ONLINE
thewhip:/ # zpool import -d /var/tmp mypool
thewhip:/ # zpool list mypool
NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
mypool   123M   110K   123M     0%  ONLINE  -

and 'zpool export' for "unmount".

regards
john

From Joerg.Schilling@fokus.fraunhofer.de Tue Apr 29 09:34:26 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TGYQIl010479
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 09:34:26 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TGYOth004681;
	Tue, 29 Apr 2008 17:34:25 +0100 (BST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300K07I1C2M00@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 10:34:24 -0600 (MDT)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300IAGI1BVZ10@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 10:34:23 -0600 (MDT)
Received: from relay16i.sun.com
 (ip126.net129179-4.block1.us.syntegra.com [129.179.4.126])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m3TGR552001300; Tue,
 29 Apr 2008 16:34:23 +0000 (GMT)
Received: from mmp13es.sun.com ([160.41.209.23] [160.41.209.23])
 by relay16i.sun.com with ESMTP id BT-MMP-438768; Tue,
 29 Apr 2008 16:34:22 +0000 (Z)
Received: from relay11i.sun.com (relay11i.sun.com [129.179.4.121])
 by mmp13es.sun.com with ESMTP id BT-MMP-163057; Tue,
 29 Apr 2008 16:34:21 +0000 (Z)
Received: from mailgw1.fraunhofer.de ([153.96.1.17] [153.96.1.17])
 by relay1i.sun.com with ESMTP id BT-MMP-598058; Tue,
 29 Apr 2008 16:34:20 +0000 (Z)
Received: from mailgw1.fraunhofer.de (localhost [127.0.0.1])
	by mailgw1.fraunhofer.de[host mailgw25] (8.14.2+/8.14.2)
 with ESMTP id m3TGXHSG007231; Tue, 29 Apr 2008 18:33:17 +0200 (CEST)
Received: from pluto.fokus.fraunhofer.de
 (pluto.fokus.fraunhofer.de [195.37.77.164])
	by mailgw1.fraunhofer.de (8.14.2+/8.14.2) with ESMTP id m3TGXHEF007214
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue,
 29 Apr 2008 18:33:17 +0200 (CEST)
Received: from EXCHSRV.fokus.fraunhofer.de (bohr [10.147.9.231])
	by pluto.fokus.fraunhofer.de (8.13.7/8.13.7) with SMTP id m3TGXG57012879; Tue,
 29 Apr 2008 18:33:17 +0200 (MEST)
Received: from rigel ([10.147.65.195]) by EXCHSRV.fokus.fraunhofer.de with
 Microsoft SMTPSVC(6.0.3790.3959); Tue, 29 Apr 2008 18:33:16 +0200
Date: Tue, 29 Apr 2008 18:33:16 +0200
From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <48173A59.7070405@sun.com>
To: darrenm@sac.sfbay.sun.com, Andrew.Gabriel@sun.com
Cc: PSARC-ext@sun.com
Message-id: <48174dcc.gDQEZCMjge49hsVV%Joerg.Schilling@fokus.fraunhofer.de>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Fraunhofer-Email-Policy: accepted
X-Antispam: No, score=-2.6/5.0, scanned in 0.249sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <48173A59.7070405@sun.com>
User-Agent: nail 11.22 3/20/05
X-OriginalArrivalTime: 29 Apr 2008 16:33:16.0740 (UTC)
 FILETIME=[BA0BD840:01C8AA16]
Status: RO
Content-Length: 1323

Andrew Gabriel <Andrew.Gabriel@sun.com> wrote:

> A couple of questions...
>
> Will the old 2 stage method using lofiadm(1M) still work unchanged?
>
> Prior to lofi/lofiadm, there was the fbk driver by Jörg Schilling
> which was used to mount an image from a file. This provided a one
> stage mount which could be included in /etc/vfstab. Just wondering
> if the team looked to see how that worked in case it might be
> useful? (My memory of it is now very hazy, but I think it used the
> backfsmount trick which was also used by cachefs.) It might be that
> it did what you are now proposing anyway.

fbk (initially written 1988) comes with a mount program that pretends that 
there is a "fbk" filesystem type.

The fbk mount program does the equivalent to lofiadm and the fbk driver 
"unmounts" the <file> at the last close(2). If there was an ioctl() to the lofi
driver that allows to tell lofi to auto-destroy file name asociations at the
last close(2), you only need a small "mount" program that does the lofiadm
task.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

From gdamore@sun.com Tue Apr 29 10:18:42 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3THIgHS012549
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 10:18:42 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m3THIeWw019237;
	Tue, 29 Apr 2008 11:18:40 -0600 (MDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300N2HK345300@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 11:18:40 -0600 (MDT)
Received: from sca-es-mail-2.sun.com ([192.18.43.133])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300II0K32VZ40@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 11:18:39 -0600 (MDT)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3THIcXX027725;
 Tue, 29 Apr 2008 10:18:38 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300A01JUCR200@fe-sfbay-10.sun.com> (original mail from gdamore@sun.com)
 ; Tue, 29 Apr 2008 10:18:38 -0700 (PDT)
Received: from [192.168.251.106] ([76.174.83.55])
 by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb
 28 2007)) with ESMTPSA id <0K03003PRK31XI50@fe-sfbay-10.sun.com>; Tue,
 29 Apr 2008 10:18:38 -0700 (PDT)
Date: Tue, 29 Apr 2008 10:13:27 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429152154.GB24481@barman.uk.sun.com>
Sender: Garrett.Damore@sun.com
To: John Levon <john.levon@sun.com>
Cc: Ceri Davies <ceri@submonkey.net>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <48175737.9090701@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071023)
Status: RO
Content-Length: 1759

Maybe I was confused.  I know that I can take a file that is in ZFS, and 
use it as a lofi device.  I know that I can use a "file" as a zpool image.

What I wasn't sure of, and maybe this is where I was confused, is can I 
lofi mount on *top* of a zfs filesystem.  E.g.

mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd

where /var and /home are both on ZFS.

    -- Garrett

John Levon wrote:
> On Tue, Apr 29, 2008 at 04:13:58PM +0100, Ceri Davies wrote:
>
>   
>>> Hmmm... I didn't realize that ZFS doesn't support lofi.  That seems like 
>>> a fairly severe shortcoming, particularly given the push towards ZFS 
>>> root.  (On a system with ZFS root, its likely there won't be *any* ufs, 
>>> etc. filesystems.)
>>>
>>> Are there any plans afoot that you're aware of to address this shortcoming?
>>>       
>> I don't think that sentence means what you think it means.  You can
>> certainly create a lofi device backed by a file on a ZFS filesystem.
>> In fact, since you can also create a zpool on a lofi device, I think it
>> just means that you can't put a ZFS/lofi combination in vfstab.
>>     
>
> Or mount a file directly. It's not a shortcoming as such, it just works
> differently. That is, the nearest ZFS equivalent of this is:
>
> thewhip:/ # zpool import -d /var/tmp 
>   pool: mypool
>     id: 5292688193707361217
>  state: ONLINE
> action: The pool can be imported using its name or numeric identifier.
> config:
>
>         mypool                 ONLINE
>           /var/tmp/mypool.img  ONLINE
> thewhip:/ # zpool import -d /var/tmp mypool
> thewhip:/ # zpool list mypool
> NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
> mypool   123M   110K   123M     0%  ONLINE  -
>
> and 'zpool export' for "unmount".
>
> regards
> john
>   


From johnlev@barman.uk.sun.com Tue Apr 29 10:27:05 2008
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3THR5pd013200
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 10:27:05 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m3THR1aN004540;
	Tue, 29 Apr 2008 10:27:05 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300043KH5I400@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 11:27:05 -0600 (MDT)
Received: from dm-uk-02.uk.sun.com ([129.156.101.196])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300IHOKH2VX40@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 11:27:03 -0600 (MDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-02.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m3THQxio017935; Tue, 29 Apr 2008 18:26:59 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1Jqtbs-0007Qx-R9; Tue, 29 Apr 2008 18:27:20 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Tue, 29 Apr 2008 18:27:20 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <48175737.9090701@sun.com>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: "Garrett D'Amore" <gdamore@sun.com>
Cc: Ceri Davies <ceri@submonkey.net>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080429172720.GA28342@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com> <48175737.9090701@sun.com>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 336

On Tue, Apr 29, 2008 at 10:13:27AM -0700, Garrett D'Amore wrote:

> What I wasn't sure of, and maybe this is where I was confused, is can I 
> lofi mount on *top* of a zfs filesystem.  E.g.
> 
> mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd
> 
> where /var and /home are both on ZFS.

Yes, that's of course possible.

regards
john

From gdamore@sun.com Tue Apr 29 11:14:08 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TIE7SG014848
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 11:14:08 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TIDqMi016567;
	Tue, 29 Apr 2008 19:14:06 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K030010BMNGSQ00@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 29 Apr 2008 11:14:04 -0700 (PDT)
Received: from sca-es-mail-2.sun.com ([192.18.43.133])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K030037ZMNFVGE0@nwk-avmta-1.sfbay.Sun.COM>; Tue,
 29 Apr 2008 11:14:03 -0700 (PDT)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TIE3UL005658;
 Tue, 29 Apr 2008 11:14:03 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300I01M4YPS00@fe-sfbay-09.sun.com> (original mail from gdamore@sun.com)
 ; Tue, 29 Apr 2008 11:14:03 -0700 (PDT)
Received: from [192.168.251.106] ([76.174.83.55])
 by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb
 28 2007)) with ESMTPSA id <0K03004B6MN51QB0@fe-sfbay-09.sun.com>; Tue,
 29 Apr 2008 11:13:54 -0700 (PDT)
Date: Tue, 29 Apr 2008 11:08:43 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429172720.GA28342@barman.uk.sun.com>
Sender: Garrett.Damore@sun.com
To: John Levon <john.levon@sun.com>
Cc: Ceri Davies <ceri@submonkey.net>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <4817642B.4050201@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com> <48175737.9090701@sun.com>
 <20080429172720.GA28342@barman.uk.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071023)
Status: RO
Content-Length: 456

John Levon wrote:
> On Tue, Apr 29, 2008 at 10:13:27AM -0700, Garrett D'Amore wrote:
>
>   
>> What I wasn't sure of, and maybe this is where I was confused, is can I 
>> lofi mount on *top* of a zfs filesystem.  E.g.
>>
>> mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd
>>
>> where /var and /home are both on ZFS.
>>     
>
> Yes, that's of course possible.
>   

Okay, then I'm happy.  Sorry for the confusion.

    -- Garrett
> regards
> john
>   


From ceri@submonkey.net Tue Apr 29 13:28:21 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TKSKOb020162
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 29 Apr 2008 13:28:21 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m3TKSDfI002822
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 30 Apr 2008 04:28:20 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300I07SV5QQ00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 29 Apr 2008 13:28:17 -0700 (PDT)
Received: from sca-ea-mail-1.sun.com ([192.18.43.24])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300BHASV325C0@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 29 Apr 2008 13:28:15 -0700 (PDT)
Received: from relay15i.sun.com
 (ip125.net129179-4.block1.us.syntegra.com [129.179.4.125])
	by sca-ea-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TKSE2a007811	for
 <PSARC-ext@sun.com>; Tue, 29 Apr 2008 20:28:15 +0000 (GMT)
Received: from mmp13es.sun.com ([160.41.209.23] [160.41.209.23])
 by relay15i.sun.com with ESMTP id BT-MMP-435466 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 20:28:14 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp13es.sun.com with ESMTP id BT-MMP-693855 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 20:28:14 +0000 (Z)
Received: from shrike.submonkey.net ([81.106.128.65] [81.106.128.65])
 by relay1ib.sun.com with ESMTP id BT-MMP-700900 for PSARC-ext@sun.com; Tue,
 29 Apr 2008 20:28:13 +0000 (Z)
Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD))
	(envelope-from <ceri@submonkey.net>)	id 1JqwQq-000L5i-U2; Tue,
 29 Apr 2008 21:28:08 +0100
Date: Tue, 29 Apr 2008 21:28:08 +0100
From: Ceri Davies <ceri@submonkey.net>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429172720.GA28342@barman.uk.sun.com>
Sender: Ceri Davies <ceri@submonkey.net>
To: John Levon <john.levon@sun.com>
Cc: "Garrett D'Amore" <gdamore@sun.com>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080429202808.GB13183@submonkey.net>
MIME-version: 1.0
Content-type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary=+g7M9IMkV8truYOl
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-PGP: finger ceri@FreeBSD.org
X-Antispam: No, score=-2.6/5.0, scanned in 0.192sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com> <48175737.9090701@sun.com>
 <20080429172720.GA28342@barman.uk.sun.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
Status: RO
Content-Length: 1198


--+g7M9IMkV8truYOl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 29, 2008 at 06:27:20PM +0100, John Levon wrote:
> On Tue, Apr 29, 2008 at 10:13:27AM -0700, Garrett D'Amore wrote:
>=20
> > What I wasn't sure of, and maybe this is where I was confused, is can I=
=20
> > lofi mount on *top* of a zfs filesystem.  E.g.
> >=20
> > mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd
> >=20
> > where /var and /home are both on ZFS.
>=20
> Yes, that's of course possible.

Although if you try to do it via vfstab, all bets are off I expect since
the mount will probably be attempted before the ZFS is mounted (although
not in this case).  I believe this is being worked on, not this case,
etc.

Ceri
--=20
That must be wonderful!  I don't understand it at all.
                                                  -- Moliere

--+g7M9IMkV8truYOl
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFIF4TYocfcwTS3JF8RAojcAJ9p5sbEF/CnllodlisaVGnFs2Aw/wCfUb0g
PlCAXdsVFeudwlQ8FFYwYP8=
=aQzh
-----END PGP SIGNATURE-----

--+g7M9IMkV8truYOl--

From johnlev@barman.uk.sun.com Tue Apr 29 13:35:25 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TKZPRa020371
	for <psarc-ext@sac.sfbay.Sun.COM>; Tue, 29 Apr 2008 13:35:25 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m3TKZGSa005424;
	Wed, 30 Apr 2008 04:35:22 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300D0DT6YHB00@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 14:35:22 -0600 (MDT)
Received: from dm-uk-01.uk.sun.com ([129.156.101.115])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300BFOT6XVG10@brm-avmta-1.central.sun.com>; Tue,
 29 Apr 2008 14:35:21 -0600 (MDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-01.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m3TKZI7J020487; Tue, 29 Apr 2008 21:35:18 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1JqwY7-0000zs-Ca; Tue, 29 Apr 2008 21:35:39 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Tue, 29 Apr 2008 21:35:39 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429202808.GB13183@submonkey.net>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Ceri Davies <ceri@submonkey.net>
Cc: "Garrett D'Amore" <gdamore@sun.com>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, psarc-ext@sun.com
Message-id: <20080429203539.GB2976@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com> <48175737.9090701@sun.com>
 <20080429172720.GA28342@barman.uk.sun.com>
 <20080429202808.GB13183@submonkey.net>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 675

On Tue, Apr 29, 2008 at 09:28:08PM +0100, Ceri Davies wrote:

> > > What I wasn't sure of, and maybe this is where I was confused, is can I 
> > > lofi mount on *top* of a zfs filesystem.  E.g.
> > > 
> > > mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd
> > > 
> > > where /var and /home are both on ZFS.
> > 
> > Yes, that's of course possible.
> 
> Although if you try to do it via vfstab, all bets are off I expect since
> the mount will probably be attempted before the ZFS is mounted (although
> not in this case).  I believe this is being worked on, not this case,
> etc.

Yeah, I believe you'd have to have a legacy ZFS mount listed in vfstab
first.

regards
john

From gdamore@sun.com Tue Apr 29 15:39:17 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3TMdGlE023574
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 29 Apr 2008 15:39:16 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3TMd1qx001603;
	Tue, 29 Apr 2008 23:39:15 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0300101YXCD800@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 15:39:13 -0700 (PDT)
Received: from sca-es-mail-2.sun.com ([192.18.43.133])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0300L6YYXCWW40@nwk-avmta-2.sfbay.sun.com>; Tue,
 29 Apr 2008 15:39:12 -0700 (PDT)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3TMdC7H008794;
 Tue, 29 Apr 2008 15:39:12 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0300601YLWTN00@fe-sfbay-10.sun.com> (original mail from gdamore@sun.com)
 ; Tue, 29 Apr 2008 15:39:12 -0700 (PDT)
Received: from [192.168.251.106] ([76.174.83.55])
 by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb
 28 2007)) with ESMTPSA id <0K0300G17YXBEAF0@fe-sfbay-10.sun.com>; Tue,
 29 Apr 2008 15:39:12 -0700 (PDT)
Date: Tue, 29 Apr 2008 15:33:59 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080429202808.GB13183@submonkey.net>
Sender: Garrett.Damore@sun.com
To: Ceri Davies <ceri@submonkey.net>
Cc: John Levon <john.levon@sun.com>,
        Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <4817A257.1010701@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <4817361C.3040409@sun.com> <20080429151358.GA13183@submonkey.net>
 <20080429152154.GB24481@barman.uk.sun.com> <48175737.9090701@sun.com>
 <20080429172720.GA28342@barman.uk.sun.com>
 <20080429202808.GB13183@submonkey.net>
User-Agent: Thunderbird 2.0.0.6 (X11/20071023)
Status: RO
Content-Length: 1078

Ceri Davies wrote:
> On Tue, Apr 29, 2008 at 06:27:20PM +0100, John Levon wrote:
>   
>> On Tue, Apr 29, 2008 at 10:13:27AM -0700, Garrett D'Amore wrote:
>>
>>     
>>> What I wasn't sure of, and maybe this is where I was confused, is can I 
>>> lofi mount on *top* of a zfs filesystem.  E.g.
>>>
>>> mount -F hsfs /home/garrett/mydvd.iso /var/tmp/dvd
>>>
>>> where /var and /home are both on ZFS.
>>>       
>> Yes, that's of course possible.
>>     
>
> Although if you try to do it via vfstab, all bets are off I expect since
> the mount will probably be attempted before the ZFS is mounted (although
> not in this case).  I believe this is being worked on, not this case,
> etc.
>   

Yeah, I know about the vfstab problem.  It bites me all the time since 
my install server uses ZFS, and I have to remember to modify /etc/vfstab 
to set mount-at-boot to "n".  (When I forget, the first time I reboot 
after installing a new version of the boot media on the install server, 
the boot fails due to milestone system/filesystem-local or somesuch.)

    -- Garrett
> Ceri
>   


From Joerg.Schilling@fokus.fraunhofer.de Wed Apr 30 06:19:19 2008
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3UDJID1012174
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 30 Apr 2008 06:19:18 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m3UDJFBX009859;
	Wed, 30 Apr 2008 14:19:16 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0500C093O2CJ00@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 30 Apr 2008 06:19:14 -0700 (PDT)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K05005XZ3O00860@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 30 Apr 2008 06:19:13 -0700 (PDT)
Received: from relay24.sun.com
 (ip192-12-251-74.block6.us.syntegra.com [192.12.251.74])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3UDGACs029130;
 Wed, 30 Apr 2008 13:19:12 +0000 (GMT)
Received: from mms24es.sun.com ([150.143.232.74] [150.143.232.74])
 by relay24i.sun.com with ESMTP id BT-MMP-475426; Wed,
 30 Apr 2008 13:19:12 +0000 (Z)
Received: from relay23.sun.com (relay23.sun.com [192.12.251.54])
 by mms24es.sun.com with ESMTP id BT-MMP-19676381; Wed,
 30 Apr 2008 13:19:11 +0000 (Z)
Received: from mailgw1.fraunhofer.de ([153.96.1.17] [153.96.1.17])
 by relay23i.sun.com with ESMTP id BT-MMP-4190613; Wed,
 30 Apr 2008 13:19:11 +0000 (Z)
Received: from mailgw1.fraunhofer.de (localhost [127.0.0.1])
	by mailgw1.fraunhofer.de[host mailgw26] (8.14.2+/8.14.2)
 with ESMTP id m3UDJ98b016322; Wed, 30 Apr 2008 15:19:09 +0200 (CEST)
Received: from pluto.fokus.fraunhofer.de
 (pluto.fokus.fraunhofer.de [195.37.77.164])
	by mailgw1.fraunhofer.de (8.14.2+/8.14.2) with ESMTP id m3UDJ8qP016258
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed,
 30 Apr 2008 15:19:09 +0200 (CEST)
Received: from EXCHSRV.fokus.fraunhofer.de (bohr [10.147.9.231])
	by pluto.fokus.fraunhofer.de (8.13.7/8.13.7) with SMTP id m3UDJ8JI007424; Wed,
 30 Apr 2008 15:19:08 +0200 (MEST)
Received: from rigel ([10.147.65.195]) by EXCHSRV.fokus.fraunhofer.de with
 Microsoft SMTPSVC(6.0.3790.3959); Wed, 30 Apr 2008 15:19:08 +0200
Date: Wed, 30 Apr 2008 15:19:08 +0200
From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
To: PSARC-ext@sun.com, darrenm@sac.sfbay.sun.com
Cc: John.Levon@sun.com
Message-id: <481871cc.xE1xW9mrCmxykXlc%Joerg.Schilling@fokus.fraunhofer.de>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Fraunhofer-Email-Policy: accepted
X-Antispam: No, score=-2.6/5.0, scanned in 0.160sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
User-Agent: nail 11.22 3/20/05
X-OriginalArrivalTime: 30 Apr 2008 13:19:08.0241 (UTC)
 FILETIME=[C569B410:01C8AAC4]
Status: RO
Content-Length: 1114

Darren J Moffat <darrenm@sac.sfbay.sun.com> wrote:

>  NOTES
>       If the directory on which a file system is to be mounted  is
> --- mount_hsfs.man	Mon Apr 28 06:57:45 2008
> +++ mount_hsfs.new	Mon Apr 28 06:55:09 2008
> @@ -32,6 +32,7 @@
>       the    missing    arguments,    including    the     FSType-
>       specific_options; see mount(1M) for more details.
>  
> +     hsfs supports loopback file mounts: see mount(1M).

....

It does not seem to be a good idea to let the incorrect name "loopback file 
mounts" taken from Linux leak into many man pages. 

The idea has first been implemented on SunOS in 1988 and the correct
naming for what's happening would be something like "emulated block device".
If at all, please use "lofi" to avoid confusion with real loopback mounts
done via "mount -F lofs".

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

From Darren.Moffat@Sun.COM Wed Apr 30 06:25:07 2008
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3UDP7Co012214
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 30 Apr 2008 06:25:07 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m3UDP6Zh027029;
	Wed, 30 Apr 2008 06:25:06 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0500F013XTII00@brm-avmta-1.central.sun.com>; Wed,
 30 Apr 2008 07:25:05 -0600 (MDT)
Received: from gmp-eb-inf-1.sun.com ([192.18.6.21])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K05008E13XSX4B0@brm-avmta-1.central.sun.com>; Wed,
 30 Apr 2008 07:25:05 -0600 (MDT)
Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe3.eu.sun.com [192.18.6.12])
	by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3UDP4QN028244; Wed,
 30 Apr 2008 13:25:04 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K050050139RUN00@fe-emea-09.sun.com>
 (original mail from Darren.Moffat@Sun.COM); Wed,
 30 Apr 2008 14:25:04 +0100 (BST)
Received: from [129.156.173.199] by fe-emea-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0K0500CL13XDN300@fe-emea-09.sun.com>; Wed,
 30 Apr 2008 14:24:49 +0100 (BST)
Date: Wed, 30 Apr 2008 14:24:49 +0100
From: Darren J Moffat <Darren.Moffat@Sun.COM>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <481871cc.xE1xW9mrCmxykXlc%Joerg.Schilling@fokus.fraunhofer.de>
Sender: Darren.Moffat@Sun.COM
To: Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>
Cc: PSARC-ext@Sun.COM, darrenm@sac.sfbay.sun.com, john.levon@Sun.COM
Message-id: <48187321.40303@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <481871cc.xE1xW9mrCmxykXlc%Joerg.Schilling@fokus.fraunhofer.de>
User-Agent: Thunderbird 2.0.0.12 (X11/20080408)
Status: RO
Content-Length: 1658

Joerg Schilling wrote:
> Darren J Moffat <darrenm@sac.sfbay.sun.com> wrote:
> 
>>  NOTES
>>       If the directory on which a file system is to be mounted  is
>> --- mount_hsfs.man	Mon Apr 28 06:57:45 2008
>> +++ mount_hsfs.new	Mon Apr 28 06:55:09 2008
>> @@ -32,6 +32,7 @@
>>       the    missing    arguments,    including    the     FSType-
>>       specific_options; see mount(1M) for more details.
>>  
>> +     hsfs supports loopback file mounts: see mount(1M).
> 
> ....
> 
> It does not seem to be a good idea to let the incorrect name "loopback file 
> mounts" taken from Linux leak into many man pages. 
> 
> The idea has first been implemented on SunOS in 1988 and the correct
> naming for what's happening would be something like "emulated block device".
> If at all, please use "lofi" to avoid confusion with real loopback mounts
> done via "mount -F lofs".

I agree with Joerg here I already see a lot of people confused between 
lofs and lofi and the language in the proposed man page changes will 
further that confusion.

I think this an appropriate comment for architecture review, rather than 
being a documentation review issue, because we need to make sure that we 
name things correctly when describing functionality especially in an 
area where there are two similarly named bits of functionality that do 
very different things.

Now if I could turn back history lofi(7D) wasn't a great name choice but 
we are stuck with it.

My suggestion for wording would be more like:

"This filesystem type supports direct mounting of files containing
the filesystem as well as block devices: see mount(1M) and lofiadm(1M)"


-- 
Darren J Moffat

From johnlev@barman.uk.sun.com Wed Apr 30 06:26:55 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m3UDQsuN012237
	for <psarc-ext@sac.sfbay.Sun.COM>; Wed, 30 Apr 2008 06:26:55 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m3UDQnBL020039
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@Sun.COM>; Wed, 30 Apr 2008 21:26:53 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0500G0D40PYD00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Wed, 30 Apr 2008 06:26:49 -0700 (PDT)
Received: from dm-uk-01.uk.sun.com ([129.156.101.115])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0500FV240O2I30@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@Sun.COM (ORCPT PSARC-ext@Sun.COM); Wed,
 30 Apr 2008 06:26:49 -0700 (PDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-01.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m3UDQjJh024092; Wed, 30 Apr 2008 14:26:45 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1JrCKx-0004hv-He; Wed, 30 Apr 2008 14:27:07 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Wed, 30 Apr 2008 14:27:07 +0100
From: John Levon <John.Levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <48187321.40303@Sun.COM>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Darren J Moffat <Darren.Moffat@sun.com>
Cc: Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>, PSARC-ext@sun.com,
        darrenm@sac.sfbay.sun.com
Message-id: <20080430132707.GA13062@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <481871cc.xE1xW9mrCmxykXlc%Joerg.Schilling@fokus.fraunhofer.de>
 <48187321.40303@Sun.COM>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 230

On Wed, Apr 30, 2008 at 02:24:49PM +0100, Darren J Moffat wrote:

> "This filesystem type supports direct mounting of files containing
> the filesystem as well as block devices: see mount(1M) and lofiadm(1M)"

Sure.

regards
john

From MAILER-DAEMON Sun May  4 02:45:05 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m449j4xA009613
	for <psarc-ext@sac.sfbay.Sun.COM>; Sun, 4 May 2008 02:45:04 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m449j0jX026653;
	Sun, 4 May 2008 17:45:01 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0C00J038EZ0D00@brm-avmta-1.central.sun.com>; Sun,
 04 May 2008 03:44:59 -0600 (MDT)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0C002J58EYI950@brm-avmta-1.central.sun.com>; Sun,
 04 May 2008 03:44:58 -0600 (MDT)
Received: from snowdog (snowdog.SFBay.Sun.COM [129.146.228.213])
	by jurassic-x4600.sfbay.sun.com (8.14.2+Sun/8.14.2)
 with ESMTP id m449iwi4769021; Sun, 04 May 2008 02:44:58 -0700 (PDT)
Date: Sun, 04 May 2008 02:47:24 -0700
From: Dan Price <dp@eng.sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
To: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, John.Levon@sun.com
Message-id: <20080504094724.GA5278@eng.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
User-Agent: Mutt/1.4.2.1i
Status: RO
Content-Length: 1923

On Tue 29 Apr 2008 at 07:39AM, Darren J Moffat wrote:
> 
>     Zones do not support lofi(7d). This case doesn't change that.

This statement is a bit vague; I think what it means to say is
that: "Processes executing inside of zones may not administratively
alter (i.e. create or destroy) lofi(7d) devices.  This case doesn't change
that."  And I agree on that front.

However: You can today mount something from a lofi device into a
nonglobal zone from the global zone during zone boot; and a lofi device
could also conceivably be imported into a zone using the 'add device'
subcommand.  (For whatever reason, the zones admin guide even documents
exactly how to do that.)

The latter is unchanged by this case.  The former would (today) 
look as follows:

zonecfg:foo> add fs
zonecfg:foo:fs> set dir=/mnt
zonecfg:foo:fs> set special=/dev/lofi/1
zonecfg:foo:fs> set type=hsfs
zonecfg:foo:fs> add options ro
zonecfg:foo:fs> end

It would be nice if this proposal fit in with that scheme; that is, with your
proposed new capability, I'd also assume that I could now do the following?

zonecfg:foo> add fs
zonecfg:foo:fs> set dir=/mnt
zonecfg:foo:fs> set special=/export/my.iso
zonecfg:foo:fs> set type=hsfs
zonecfg:foo:fs> add options ro
zonecfg:foo:fs> end

If memory serves me correctly, we simply invoke mount(1m), but that would
be a nice thing for you to check in your testing.  We'd probably also like
to add this to the zones documentation, so please do touch base with the
zones team so that we can drive documentation updates.

Two final questions: (1) is there any potential interaction with fsck(1m)
here?  In other words, if the file we're looping back represents an FS
which requires an fsck stage, how will that work?  (2) Will the lofi nodes
created in this manner be visible in the output of lofiadm(1m)?

Thanks,

        -dp

-- 
Daniel Price - Solaris Kernel Engineering - dp@eng.sun.com - blogs.sun.com/dp

From johnlev@barman.uk.sun.com Sun May  4 12:37:04 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m44Jb39j019519
	for <psarc-ext@sac.sfbay.Sun.COM>; Sun, 4 May 2008 12:37:03 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m44JavOK012365
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@Sun.COM>; Mon, 5 May 2008 03:37:02 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0C00M05ZTOQR00@brm-avmta-1.central.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Sun, 04 May 2008 13:37:00 -0600 (MDT)
Received: from dm-uk-01.uk.sun.com ([129.156.101.115])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0C00FCJZTNSA40@brm-avmta-1.central.sun.com> for
 PSARC-ext@Sun.COM (ORCPT PSARC-ext@Sun.COM); Sun,
 04 May 2008 13:37:00 -0600 (MDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-01.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m44Jattd027361; Sun, 04 May 2008 20:36:55 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1Jsk1T-0005tc-Aj; Sun, 04 May 2008 20:37:23 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Sun, 04 May 2008 20:37:23 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080504094724.GA5278@eng.sun.com>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Dan Price <dp@eng.sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080504193722.GA19465@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <20080504094724.GA5278@eng.sun.com>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 1438

On Sun, May 04, 2008 at 02:47:24AM -0700, Dan Price wrote:

> It would be nice if this proposal fit in with that scheme; that is, with your
> proposed new capability, I'd also assume that I could now do the following?

Good questions.

> zonecfg:foo> add fs
> zonecfg:foo:fs> set dir=/mnt
> zonecfg:foo:fs> set special=/export/my.iso
> zonecfg:foo:fs> set type=hsfs
> zonecfg:foo:fs> add options ro
> zonecfg:foo:fs> end

I agree that this should work, but zoneadm isn't ready yet:

- it uses stat() not stat64() on the special device
- for other than hsfs, it insists upon a raw device

The former is (presumably) a simple fix. The latter is trickier: we
don't have a raw device to fsck. Perhaps zoneadm shouldn't be insisting
on a fsck pass anyway, or maybe this just shouldn't be allowed. What do
you think?

> Two final questions: (1) is there any potential interaction with fsck(1m)
> here?  In other words, if the file we're looping back represents an FS
> which requires an fsck stage, how will that work?

Exactly like it does with lofiadm+mount today (or any direct mount
invocation): it'll mount without checking.

>  (2) Will the lofi nodes created in this manner be visible in the
>  output of lofiadm(1m)?

Yes. I did toy with an alternative where it won't appear in /devices/,
but it was not nice implementation-wise, and after some thought felt
that listing the lofi entries was the right thing to do anyway.

regards
john

From MAILER-DAEMON Sun May  4 18:13:46 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m451Djol025707
	for <psarc-ext@sac.sfbay.Sun.COM>; Sun, 4 May 2008 18:13:46 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m451Dg45023340;
	Mon, 5 May 2008 09:13:43 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0D00501FEUPV00@nwk-avmta-1.sfbay.Sun.COM>; Sun,
 04 May 2008 18:13:42 -0700 (PDT)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.59])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0D005D2FEUIM00@nwk-avmta-1.sfbay.Sun.COM>; Sun,
 04 May 2008 18:13:42 -0700 (PDT)
Received: from snowdog (snowdog.SFBay.Sun.COM [129.146.228.213])
	by jurassic-x4600.sfbay.sun.com (8.14.2+Sun/8.14.2)
 with ESMTP id m451Dg7H807462; Sun, 04 May 2008 18:13:42 -0700 (PDT)
Date: Sun, 04 May 2008 18:16:11 -0700
From: Dan Price <dp@eng.sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080504193722.GA19465@barman.uk.sun.com>
To: John Levon <john.levon@sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080505011605.GA5888@eng.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <20080504094724.GA5278@eng.sun.com> <20080504193722.GA19465@barman.uk.sun.com>
User-Agent: Mutt/1.4.2.1i
Status: RO
Content-Length: 1856

On Sun 04 May 2008 at 08:37PM, John Levon wrote:
> I agree that this should work, but zoneadm isn't ready yet:
> 
> - it uses stat() not stat64() on the special device
> - for other than hsfs, it insists upon a raw device

(Where is that hsfs special-case code?)

> The former is (presumably) a simple fix. The latter is trickier: we
> don't have a raw device to fsck. Perhaps zoneadm shouldn't be insisting
> on a fsck pass anyway, or maybe this just shouldn't be allowed. What do
> you think?

Sorry-- I may be *totally* confused, but...

Why couldn't one fsck an e.g. ufs image living in a file?  fsck
seems to be OK with that at least for UFS.

> > Two final questions: (1) is there any potential interaction with fsck(1m)
> > here?  In other words, if the file we're looping back represents an FS
> > which requires an fsck stage, how will that work?
> 
> Exactly like it does with lofiadm+mount today (or any direct mount
> invocation): it'll mount without checking.

I guess what I meant was that with lofiadm + mounting today, presumably
I can specify fsck'ing in /etc/vfstab when I place a vfstab entry
there.  Maybe no one does that, or even uses vfstab, since the lofi
devices don't persist across reboot.

On the other hand, the man page suggests that one write a script to
persist lofi configurations (blech).  I wish lofiadm just supported that
natively.

> >  (2) Will the lofi nodes created in this manner be visible in the
> >  output of lofiadm(1m)?
> 
> Yes. I did toy with an alternative where it won't appear in /devices/,
> but it was not nice implementation-wise, and after some thought felt
> that listing the lofi entries was the right thing to do anyway.

Ok, thanks.  You might wish to amend the proposal to specifically state
that.

        -dp

-- 
Daniel Price - Solaris Kernel Engineering - dp@eng.sun.com - blogs.sun.com/dp

From johnlev@barman.uk.sun.com Sun May  4 18:36:09 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m451a85A025799
	for <psarc-ext@sac.sfbay.Sun.COM>; Sun, 4 May 2008 18:36:08 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m451Zs0r000122
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Mon, 5 May 2008 09:36:07 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0D00801GG5BK00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sun, 04 May 2008 18:36:05 -0700 (PDT)
Received: from dm-uk-01.uk.sun.com ([129.156.101.115])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0D005AXGG4IM50@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sun,
 04 May 2008 18:36:05 -0700 (PDT)
Received: from barman.uk.sun.com (barman.UK.Sun.COM [129.156.132.12])
	by dm-uk-01.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2)
 with ESMTP id m451a0kG029512; Mon, 05 May 2008 02:36:01 +0100 (BST)
Received: from johnlev by barman.uk.sun.com with local (Exim 4.42)
	id 1Jspcy-0005FG-HS; Mon, 05 May 2008 02:36:28 +0100
X-URL: http://jurassic.eng/~johnlev/
Date: Mon, 05 May 2008 02:36:28 +0100
From: John Levon <john.levon@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080505011605.GA5888@eng.sun.com>
Sender: John Levon <johnlev@barman.uk.sun.com>
To: Dan Price <dp@eng.sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080505013628.GA8740@barman.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <20080504094724.GA5278@eng.sun.com> <20080504193722.GA19465@barman.uk.sun.com>
 <20080505011605.GA5888@eng.sun.com>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 2496

On Sun, May 04, 2008 at 06:16:11PM -0700, Dan Price wrote:

> > I agree that this should work, but zoneadm isn't ready yet:
> > 
> > - it uses stat() not stat64() on the special device
> > - for other than hsfs, it insists upon a raw device
> 
> (Where is that hsfs special-case code?)

zoneadm looks for /usr/lib/fs/<type>/fsck, and assumes that an fsck pass
is not necessary if it doesn't exist.

> > The former is (presumably) a simple fix. The latter is trickier: we
> > don't have a raw device to fsck. Perhaps zoneadm shouldn't be insisting
> > on a fsck pass anyway, or maybe this just shouldn't be allowed. What do
> > you think?
> 
> Sorry-- I may be *totally* confused, but...
> 
> Why couldn't one fsck an e.g. ufs image living in a file?  fsck
> seems to be OK with that at least for UFS.

It works for UFS, but zoneadm insists upon a 'raw' device, and does fsck
on that.

pcfs refuses to fsck a file. udfs asks you, then refuses to do so
anyway. I'm not sure fixing either of these are in scope.

So I can change zoneadm to allow no raw device if special is a file,
and zoneadmd to fsck the file, but this won't work for pcfs or udfs.

Seem reasonable?

> > > Two final questions: (1) is there any potential interaction with fsck(1m)
> > > here?  In other words, if the file we're looping back represents an FS
> > > which requires an fsck stage, how will that work?
> > 
> > Exactly like it does with lofiadm+mount today (or any direct mount
> > invocation): it'll mount without checking.
> 
> I guess what I meant was that with lofiadm + mounting today, presumably
> I can specify fsck'ing in /etc/vfstab when I place a vfstab entry
> there.  Maybe no one does that, or even uses vfstab, since the lofi
> devices don't persist across reboot.
> 
> On the other hand, the man page suggests that one write a script to
> persist lofi configurations (blech).  I wish lofiadm just supported that
> natively.

I missed that part of the manpage, but I'm dubious as to its utility
anyway. /etc/vfstab is getting less and less relevant.

> > >  (2) Will the lofi nodes created in this manner be visible in the
> > >  output of lofiadm(1m)?
> > 
> > Yes. I did toy with an alternative where it won't appear in /devices/,
> > but it was not nice implementation-wise, and after some thought felt
> > that listing the lofi entries was the right thing to do anyway.
> 
> Ok, thanks.  You might wish to amend the proposal to specifically state
> that.

I think this record will do...

cheers
john

From Nicolas.Williams@sun.com Mon May  5 08:35:25 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m45FZOIq015053
	for <psarc-ext@sac.sfbay.Sun.COM>; Mon, 5 May 2008 08:35:24 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m45FZ2KK004165;
	Mon, 5 May 2008 23:35:21 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0E00903JAU2P00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 05 May 2008 08:35:18 -0700 (PDT)
Received: from binky.Central.Sun.COM ([129.153.128.104])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0E0083SJATQQ00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 05 May 2008 08:35:17 -0700 (PDT)
Received: from binky.Central.Sun.COM (localhost [127.0.0.1])
	by binky.Central.Sun.COM (8.14.1+Sun/8.14.1) with ESMTP id m45FZGMr020986;
 Mon, 05 May 2008 10:35:16 -0500 (CDT)
Received: (from nw141292@localhost)
	by binky.Central.Sun.COM (8.14.1+Sun/8.14.1/Submit) id m45FZGjw020985; Mon,
 05 May 2008 10:35:16 -0500 (CDT)
Date: Mon, 05 May 2008 10:35:16 -0500
From: Nicolas Williams <Nicolas.Williams@sun.com>
Subject: Re: lofi mount [PSARC/2008/290 FastTrack timeout 05/06/2008]
In-reply-to: <20080504193722.GA19465@barman.uk.sun.com>
To: John Levon <john.levon@sun.com>
Cc: Dan Price <dp@eng.sun.com>, Darren J Moffat <darrenm@sac.sfbay.sun.com>,
        PSARC-ext@sun.com
Mail-followup-to: John Levon <john.levon@sun.com>, Dan Price <dp@eng.sun.com>,
 Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com
Message-id: <20080505153516.GY13552@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <200804291439.m3TEdSG0006162@sac.sfbay.sun.com>
 <20080504094724.GA5278@eng.sun.com> <20080504193722.GA19465@barman.uk.sun.com>
X-Authentication-warning: binky.Central.Sun.COM: nw141292 set sender to
 Nicolas.Williams@sun.com using -f
User-Agent: Mutt/1.5.7i
Status: RO
Content-Length: 773

On Sun, May 04, 2008 at 08:37:23PM +0100, John Levon wrote:
> On Sun, May 04, 2008 at 02:47:24AM -0700, Dan Price wrote:
> > Two final questions: (1) is there any potential interaction with fsck(1m)
> > here?  In other words, if the file we're looping back represents an FS
> > which requires an fsck stage, how will that work?
> 
> Exactly like it does with lofiadm+mount today (or any direct mount
> invocation): it'll mount without checking.

But if you can reference a lofi mount from vfstab then it should be
possible to fsck a file-backed UFS filesystem.  That might mean changing
fsck(1M).  OTOH, I think this feature is primarily needed for use with
hsfs images, so not being able to fsck UFS lofi mounts without using
lofiadm(1M) sounds tolerable to me.

Nico
-- 

From Darren.Moffat@sun.com Wed May  7 13:11:48 2008
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m47KBlZF016319
	for <psarc-ext@sac.sfbay.Sun.COM>; Wed, 7 May 2008 13:11:47 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id m47KBgjN019273;
	Thu, 8 May 2008 04:11:44 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0K0I00A0BLFI1H00@nwk-avmta-2.sfbay.sun.com>; Wed,
 07 May 2008 13:11:42 -0700 (PDT)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0K0I003E6LFG8H90@nwk-avmta-2.sfbay.sun.com>; Wed,
 07 May 2008 13:11:41 -0700 (PDT)
Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe1.eu.sun.com [192.18.6.10])
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m47KBew0014827; Wed,
 07 May 2008 20:11:40 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0K0I00301LBLZK00@fe-emea-09.sun.com>
 (original mail from Darren.Moffat@Sun.COM); Wed,
 07 May 2008 21:11:40 +0100 (BST)
Received: from [129.156.173.199] by fe-emea-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0K0I00DUDLFF8610@fe-emea-09.sun.com>; Wed,
 07 May 2008 21:11:40 +0100 (BST)
Date: Wed, 07 May 2008 21:11:39 +0100
From: Darren J Moffat <Darren.Moffat@sun.com>
Subject: [closed approved] PSARC/2008/290 lofi mount
Sender: Darren.Moffat@sun.com
To: PSARC-EXT@sun.com, John.Levon@sun.com
Message-id: <48220CFB.7020407@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
User-Agent: Thunderbird 2.0.0.12 (X11/20080408)
Status: RO
Content-Length: 100

This case has timed out with no unresolved issues and is now closed 
approved.

-- 
Darren J Moffat

