From mi@aldan.algebra.com  Fri Apr 23 18:57:43 2010
Return-Path: <mi@aldan.algebra.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6CA3106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Apr 2010 18:57:43 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102])
	by mx1.freebsd.org (Postfix) with ESMTP id A32668FC17
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Apr 2010 18:57:43 +0000 (UTC)
Received: from mr08.lnh.mail.rcn.net ([207.172.157.28])
  by smtp02.lnh.mail.rcn.net with ESMTP; 23 Apr 2010 14:57:43 -0400
Received: from mx04.lnh.mail.rcn.net (mx04.lnh.mail.rcn.net [207.172.157.54])
	by mr08.lnh.mail.rcn.net (MOS 3.10.8-GA)
	with ESMTP id LOK10084;
	Fri, 23 Apr 2010 14:57:42 -0400 (EDT)
Received: from pool-173-70-194-135.nwrknj.fios.verizon.net (HELO aldan.narawntapu) ([173.70.194.135])
  by smtp04.lnh.mail.rcn.net with ESMTP; 23 Apr 2010 14:57:42 -0400
Received: from aldan.narawntapu (localhost [127.0.0.1])
	by aldan.narawntapu (8.14.4/8.14.3) with ESMTP id o3NIvf6H052275
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Apr 2010 14:57:41 -0400 (EDT)
	(envelope-from mi@aldan.algebra.com)
Received: (from mi@localhost)
	by aldan.narawntapu (8.14.4/8.14.3/Submit) id o3NIvf0w052272;
	Fri, 23 Apr 2010 14:57:41 -0400 (EDT)
	(envelope-from mi)
Message-Id: <201004231857.o3NIvf0w052272@aldan.narawntapu>
Date: Fri, 23 Apr 2010 14:57:41 -0400 (EDT)
From: "Mikhail T." <mi@aldan.algebra.com>
Reply-To: "Mikhail T." <mi@aldan.algebra.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: optional offset for `mdconfig -t vnode'
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         145999
>Category:       kern
>Synopsis:       [request] optional offset for `mdconfig -t vnode'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    wblock
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 23 19:00:12 UTC 2010
>Closed-Date:    Mon Nov 26 22:43:39 UTC 2012
>Last-Modified:  Mon Nov 26 22:43:39 UTC 2012
>Originator:     Mikhail T.
>Release:        FreeBSD 7.3-STABLE amd64
>Organization:
Virtual Estates, Inc.	http://sybpipe.com/
>Environment:
System: FreeBSD aldan.narawntapu 7.3-STABLE FreeBSD 7.3-STABLE #3: Fri Apr 9 17:20:45 EDT 2010 mi@aldan.narawntapu:/var/src/sys/amd64/compile/SILVER-SMP amd64

>Description:

	It is already possible to use only part of the file by
	explicitly specifying the size (mdconfig -s) of the md.

	For completeness, it should also be possible to request, that
	certain number of bytes be skipped from the beginning...

	If necessary, requiring that this offset be a multiple of
	512 or some such is acceptable.

	For example:

		mdconfig -t vnode -f zhoo -b 8192

	(-b would stand for "begin").

>How-To-Repeat:

	This could be useful for people dealing with files, that have
	file-system images embedded in them -- preceded by some other
	data...

	The only existing work-around for such situations is using
	something like dd skip= to produce a separate file, which
	can almost double the storage requirements and cause other
	inconvenience.

	I propose, that the md_base field of the md_ioctl struct
	(currently in use only in the MD_PRELOAD cases) be used
	for this purpose.

>Fix:

	The userland changes (add an option for mdconfig.c) is easy.
	The kernel changes required are beyond my knowledge...
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Sat Apr 24 00:41:52 UTC 2010 
State-Changed-Why:  
Mark suspended awaiting patches. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145999 

From: Mateusz Guzik <mjguzik@gmail.com>
To: bug-followup@FreeBSD.org, mi@aldan.algebra.com
Cc:  
Subject: Re: kern/145999: [request] optional offset for `mdconfig -t vnode'
Date: Thu, 18 Nov 2010 19:29:05 +0100

 This can be achieved with gnop(8).
 
 $ mdocnfig -t vnode <image>
 md0
 $ gnop create -o <offset in bytes> md0
 $ ls /dev/md0*
 /dev/md0         /dev/md0.nop     /dev/md0.nops1   /dev/md0.nops1a
 /dev/md0.nops1b  /dev/md0.nops1d
 
 Have fun. :)
 -- 
 Mateusz Guzik
Responsible-Changed-From-To: freebsd-bugs->mjg 
Responsible-Changed-By: mjg 
Responsible-Changed-When: Sat Nov 3 15:50:35 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145999 
State-Changed-From-To: suspended->closed 
State-Changed-By: mjg 
State-Changed-When: Sat Nov 3 15:51:54 UTC 2012 
State-Changed-Why:  
Requested behaviour can be achieved by using gnop, as described in 
follow-up mail 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145999 

From: "Mikhail T." <mi+thun@aldan.algebra.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/145999: [request] optional offset for `mdconfig -t vnode'
Date: Sat, 03 Nov 2012 12:21:26 -0400

 Does not use of gnop add several more levels of software? In other 
 words, is not it just a work-around for the missing functionality?

From: Mateusz Guzik <mjguzik@gmail.com>
To: bug-followup@FreeBSD.org, mi@aldan.algebra.com
Cc:  
Subject: Re: kern/145999: [request] optional offset for `mdconfig -t vnode'
Date: Sat, 3 Nov 2012 20:42:14 +0100

 Hi,
 
 > Does not use of gnop add several more levels of software? In other
 > words, is not it just a work-around for the missing functionality?
 
 Yes, all I/O goes through another GEOM class (gnop), but I don't see any
 downsides here. Setup is not more complicated and there should be almost
 no performance difference. Do you have other concerns here?
 
 I'd like to note that stacking GEOM classes with different features is
 normal in FreeBSD (whether this feature should be present in a class
 named GNOP is another issue, but the point is that now you can do I/O
 with specified offset to everything (not just md devices) if you need to).
 
 Patching md to support this is trivial, I just don't see any reason to
 do so since you can get very same effect already and it costs nothing.
 
 -- 
 Mateusz Guzik <mjguzik gmail.com>

From: "Mikhail T." <mi+thun@aldan.algebra.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/145999: [request] optional offset for `mdconfig -t vnode'
Date: Sat, 03 Nov 2012 20:01:36 -0400

 This is a multi-part message in MIME format.
 --------------040102090107050901050802
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit
 
 On 03.11.2012 15:42, Mateusz Guzik wrote:
 > Patching md to support this is trivial, I just don't see any reason to
 > do so since you can get very same effect already and it costs nothing.
 I'd think, there is a cost -- in inter-layer software processing and 
 setup complexity...
 
 For example, setting up md-backed tmpfs is easy and well documented 
 (since the times, when geom was a cool new thing). If adding the support 
 for offset is, indeed, trivial, I think, it should be added...
 
 Yours,
 
     -mi
 
 
 --------------040102090107050901050802
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: 7bit
 
 <html>
   <head>
     <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
   </head>
   <body bgcolor="#FFFFFF" text="#000000">
     <div class="moz-cite-prefix">On 03.11.2012 15:42, Mateusz Guzik
       wrote:<br>
     </div>
     <blockquote cite="mid:20121103194214.GA29883@dft-labs.eu"
       type="cite">
       <pre wrap="">Patching md to support this is trivial, I just don't see any reason to
 do so since you can get very same effect already and it costs nothing.</pre>
     </blockquote>
     I'd think, there is a cost -- in inter-layer software processing and
     setup complexity...<br>
     <br>
     For example, setting up md-backed tmpfs is easy and well documented
     (since the times, when geom was a cool new thing). If adding the
     support for offset is, indeed, trivial, I think, it should be
     added...<br>
     <br>
     Yours,<br>
     <blockquote>-mi<br>
     </blockquote>
   </body>
 </html>
 
 --------------040102090107050901050802--
State-Changed-From-To: closed->open 
State-Changed-By: wblock 
State-Changed-When: Sun Nov 4 00:53:28 UTC 2012 
State-Changed-Why:  
With mjg's permission, take to add example use of gnop to mdconfig(8). 


Responsible-Changed-From-To: mjg->wblock 
Responsible-Changed-By: wblock 
Responsible-Changed-When: Sun Nov 4 00:53:28 UTC 2012 
Responsible-Changed-Why:  
With mjg's permission, take to add example use of gnop to mdconfig(8). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145999 
State-Changed-From-To: open->closed 
State-Changed-By: wblock 
State-Changed-When: Mon Nov 26 22:41:05 UTC 2012 
State-Changed-Why:  
The mdconfig.8 man page was updated with an example showing the use of 
gnop(8) to skip over arbitrary header data, and has been MFCed to 9-STABLE, 
8-STABLE, and 7-STABLE.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145999 
>Unformatted:
