public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* do we support using a file as logdev?
@ 2010-04-20 14:36 Wengang Wang
  2010-04-20 15:27 ` Iustin Pop
  2010-04-20 17:01 ` Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: Wengang Wang @ 2010-04-20 14:36 UTC (permalink / raw)
  To: xfs; +Cc: greg.marsden, joe.jin, wen.gang.wang

Hi experts,

Do we support using a file as log device?
If no, it's strange that we support running xfs on a file but don't support log
file.
If yes, it fails at mount.

[root@desk test-xfsprogs]# mkfs.xfs
-llogdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile,size=32768b
/dev/sda10 -f
meta-data=/dev/sda10             isize=256    agcount=4, agsize=1250558
blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=5002231, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =/root/test-xfsprogs/test-xfsprogs-tmp/imagefile bsize=4096
blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@desk test-xfsprogs]# mount
-ologdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile /dev/sda10 /xfs
mount: the kernel does not recognize /dev/sda10 as a block device
       (maybe `insmod driver'?)

regards,
wengang.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do we support using a file as logdev?
  2010-04-20 14:36 do we support using a file as logdev? Wengang Wang
@ 2010-04-20 15:27 ` Iustin Pop
  2010-04-20 16:09   ` Wengang Wang
  2010-04-20 17:01 ` Eric Sandeen
  1 sibling, 1 reply; 5+ messages in thread
From: Iustin Pop @ 2010-04-20 15:27 UTC (permalink / raw)
  To: Wengang Wang; +Cc: greg.marsden, joe.jin, xfs

On Tue, Apr 20, 2010 at 10:36:56PM +0800, Wengang Wang wrote:
> Hi experts,
> 
> Do we support using a file as log device?
> If no, it's strange that we support running xfs on a file but don't support log
> file.

Have you tried using losetup and passing the loop device instead?

regards,
iustin

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do we support using a file as logdev?
  2010-04-20 15:27 ` Iustin Pop
@ 2010-04-20 16:09   ` Wengang Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Wengang Wang @ 2010-04-20 16:09 UTC (permalink / raw)
  To: Wengang Wang, xfs, greg.marsden, joe.jin

On 10-04-20 17:27, Iustin Pop wrote:
> On Tue, Apr 20, 2010 at 10:36:56PM +0800, Wengang Wang wrote:
> > Hi experts,
> > 
> > Do we support using a file as log device?
> > If no, it's strange that we support running xfs on a file but don't support log
> > file.
> 
> Have you tried using losetup and passing the loop device instead?

Yes, that's a workaround.

regards,
wengang.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do we support using a file as logdev?
  2010-04-20 14:36 do we support using a file as logdev? Wengang Wang
  2010-04-20 15:27 ` Iustin Pop
@ 2010-04-20 17:01 ` Eric Sandeen
  2010-04-21  3:03   ` Wengang Wang
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2010-04-20 17:01 UTC (permalink / raw)
  To: Wengang Wang; +Cc: greg.marsden, joe.jin, xfs

On 04/20/2010 09:36 AM, Wengang Wang wrote:
> Hi experts,
> 
> Do we support using a file as log device?
> If no, it's strange that we support running xfs on a file but don't support log
> file.
> If yes, it fails at mount.
> 
> [root@desk test-xfsprogs]# mkfs.xfs
> -llogdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile,size=32768b
> /dev/sda10 -f
> meta-data=/dev/sda10             isize=256    agcount=4, agsize=1250558
> blks
>          =                       sectsz=512   attr=2
> data     =                       bsize=4096   blocks=5002231, imaxpct=25
>          =                       sunit=0      swidth=0 blks
> naming   =version 2              bsize=4096   ascii-ci=0
> log      =/root/test-xfsprogs/test-xfsprogs-tmp/imagefile bsize=4096
> blocks=32768, version=2
>          =                       sectsz=512   sunit=0 blks, lazy-count=0
> realtime =none                   extsz=4096   blocks=0, rtextents=0
> [root@desk test-xfsprogs]# mount
> -ologdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile /dev/sda10 /xfs
> mount: the kernel does not recognize /dev/sda10 as a block device
>        (maybe `insmod driver'?)

Well, -o logdev=$BLAH sets up m_logname with that value in the mount
point, and xfs_open_devices() then tries:

        if (mp->m_logname) {
                error = xfs_blkdev_get(mp, mp->m_logname, &logdev);

which eventually does

	open_bdev_exclusive(name, FMODE_READ|FMODE_WRITE, mp);
/**
 * open_bdev_exclusive  -  open a block device by name and set it up for use
 *
 * @path:       special file representing the block device
 * @mode:       FMODE_... combination to pass be used
 * @holder:     owner for exclusion
 *
 * Open the blockdevice described by the special file at @path, claim it
 * for the @holder.
 */

... this is all in kernelspace, which has no notion of what
/root/test-xfsprogs/test-xfsprogs-tmp/imagefile might be.  You'll need
to use a devicename that open_bdev_exclusive() can understand (like
/dev/loop0, as suggested)

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: do we support using a file as logdev?
  2010-04-20 17:01 ` Eric Sandeen
@ 2010-04-21  3:03   ` Wengang Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Wengang Wang @ 2010-04-21  3:03 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, joe.jin, greg.marsden, Wengang Wang

On 10-04-20 12:01, Eric Sandeen wrote:
> On 04/20/2010 09:36 AM, Wengang Wang wrote:
> > Hi experts,
> > 
> > Do we support using a file as log device?
> > If no, it's strange that we support running xfs on a file but don't support log
> > file.
> > If yes, it fails at mount.
> > 
> > [root@desk test-xfsprogs]# mkfs.xfs
> > -llogdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile,size=32768b
> > /dev/sda10 -f
> > meta-data=/dev/sda10             isize=256    agcount=4, agsize=1250558
> > blks
> >          =                       sectsz=512   attr=2
> > data     =                       bsize=4096   blocks=5002231, imaxpct=25
> >          =                       sunit=0      swidth=0 blks
> > naming   =version 2              bsize=4096   ascii-ci=0
> > log      =/root/test-xfsprogs/test-xfsprogs-tmp/imagefile bsize=4096
> > blocks=32768, version=2
> >          =                       sectsz=512   sunit=0 blks, lazy-count=0
> > realtime =none                   extsz=4096   blocks=0, rtextents=0
> > [root@desk test-xfsprogs]# mount
> > -ologdev=/root/test-xfsprogs/test-xfsprogs-tmp/imagefile /dev/sda10 /xfs
> > mount: the kernel does not recognize /dev/sda10 as a block device
> >        (maybe `insmod driver'?)
> 
> Well, -o logdev=$BLAH sets up m_logname with that value in the mount
> point, and xfs_open_devices() then tries:
> 
>         if (mp->m_logname) {
>                 error = xfs_blkdev_get(mp, mp->m_logname, &logdev);
> 
> which eventually does
> 
> 	open_bdev_exclusive(name, FMODE_READ|FMODE_WRITE, mp);
> /**
>  * open_bdev_exclusive  -  open a block device by name and set it up for use
>  *
>  * @path:       special file representing the block device
>  * @mode:       FMODE_... combination to pass be used
>  * @holder:     owner for exclusion
>  *
>  * Open the blockdevice described by the special file at @path, claim it
>  * for the @holder.
>  */
> 
> ... this is all in kernelspace, which has no notion of what
> /root/test-xfsprogs/test-xfsprogs-tmp/imagefile might be.  You'll need
> to use a devicename that open_bdev_exclusive() can understand (like
> /dev/loop0, as suggested)

I see.
Thanks Eric for your detailed explanation!

regards,
wengang.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-21  3:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 14:36 do we support using a file as logdev? Wengang Wang
2010-04-20 15:27 ` Iustin Pop
2010-04-20 16:09   ` Wengang Wang
2010-04-20 17:01 ` Eric Sandeen
2010-04-21  3:03   ` Wengang Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox