All of lore.kernel.org
 help / color / mirror / Atom feed
* xfs_freeze
@ 2014-06-19  5:09 陈文东
  2014-06-19  5:42 ` xfs_freeze Dave Chinner
  0 siblings, 1 reply; 7+ messages in thread
From: 陈文东 @ 2014-06-19  5:09 UTC (permalink / raw)
  To: xfs


[-- Attachment #1.1: Type: text/plain, Size: 450 bytes --]

Hi:

[root@localhost /]# mount /dev/lvm_vg/lvm_lv /nas/
[root@localhost /]# xfs_freeze -f /nas/
[root@localhost /]# lvcreate  -s -L 40M -n cwd  /dev/lvm_vg/lvm_lv
  Rounding up size to full physical extent 48.00 MiB
  device-mapper: suspend ioctl on  failed: Device or resource busy
  Unable to suspend lvm_vg-lvm_lv (253:0)
  Failed to suspend origin lvm_lv
  libdevmapper exiting with 2 device(s) still suspended.




Why?

Thanks

[-- Attachment #1.2: Type: text/html, Size: 3454 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

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

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

* Re: xfs_freeze
  2014-06-19  5:09 xfs_freeze 陈文东
@ 2014-06-19  5:42 ` Dave Chinner
  2014-06-19  6:46   ` 答复: xfs_freeze 陈文东
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2014-06-19  5:42 UTC (permalink / raw)
  To: 陈文东; +Cc: xfs

On Thu, Jun 19, 2014 at 05:09:04AM +0000, 陈文东 wrote:
> Hi:
> 
> [root@localhost /]# mount /dev/lvm_vg/lvm_lv /nas/
> [root@localhost /]# xfs_freeze -f /nas/
> [root@localhost /]# lvcreate  -s -L 40M -n cwd  /dev/lvm_vg/lvm_lv
>   Rounding up size to full physical extent 48.00 MiB
>   device-mapper: suspend ioctl on  failed: Device or resource busy
>   Unable to suspend lvm_vg-lvm_lv (253:0)
>   Failed to suspend origin lvm_lv
>   libdevmapper exiting with 2 device(s) still suspended.
> 
> 
> 
> 
> Why?

commit 18e9e5104fcd9a973ffe3eed3816c87f2a1b6cd2
Author: Josef Bacik <josef@redhat.com>
Date:   Tue Mar 23 10:34:56 2010 -0400

    Introduce freeze_super and thaw_super for the fsfreeze ioctl
    
    Currently the way we do freezing is by passing sb>s_bdev to freeze_bdev and the
    letting it do all the work.  But freezing is more of an fs thing, and doesn't
    really have much to do with the bdev at all, all the work gets done with the
    super.  In btrfs we do not populate s_bdev, since we can have multiple bdev's
    for one fs and setting s_bdev makes removing devices from a pool kind of tricky
    This means that freezing a btrfs filesystem fails, which causes us to corrupt
    with things like tux-on-ice which use the fsfreeze mechanism.  So instead of
    populating sb->s_bdev with a random bdev in our pool, I've broken the actual fs
    freezing stuff into freeze_super and thaw_super.  These just take the
    super_block that we're freezing and does the appropriate work.  It's basically
    just copy and pasted from freeze_bdev.  I've then converted freeze_bdev over to
    use the new super helpers.  I've tested this with ext4 and btrfs and verified
    everything continues to work the same as before.
    
    The only new gotcha is multiple calls to the fsfreeze ioctl will return EBUSY i
    the fs is already frozen.  I thought this was a better solution than adding a
    freeze counter to the super_block, but if everybody hates this idea I'm open to
    suggestions.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


IOWs, if you freeze the superblock via xfs_freeze or fsfreeze, you
cannot nest freeze requests - you'll get EBUSY on teh second attempt
to freeze the superblock. 

lvcreate must be doing a freeze from the block device, so it's
failing with EBUSY because the superblock on the block device is
already frozen...

-Dave.
-- 
Dave Chinner
david@fromorbit.com

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

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

* 答复: xfs_freeze
  2014-06-19  5:42 ` xfs_freeze Dave Chinner
@ 2014-06-19  6:46   ` 陈文东
  2014-06-19  8:48     ` xfs_freeze Emmanuel Florac
  0 siblings, 1 reply; 7+ messages in thread
From: 陈文东 @ 2014-06-19  6:46 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

Hi:

What Would  Xfs Snapshot Do?

Xfs_freeze 

SYS:Linux localhost.localdomain 3.10.0-54.0.1.el7.x86_64 #1 SMP Tue Nov 26 16:51:22 EST 2013 x86_64 x86_64 x86_64 GNU/Linux


-----邮件原件-----
发件人: Dave Chinner [mailto:david@fromorbit.com] 
发送时间: 2014年6月19日 13:42
收件人: 陈文东
抄送: xfs@oss.sgi.com
主题: Re: xfs_freeze

On Thu, Jun 19, 2014 at 05:09:04AM +0000, 陈文东 wrote:
> Hi:
> 
> [root@localhost /]# mount /dev/lvm_vg/lvm_lv /nas/ [root@localhost /]# 
> xfs_freeze -f /nas/ [root@localhost /]# lvcreate  -s -L 40M -n cwd  
> /dev/lvm_vg/lvm_lv
>   Rounding up size to full physical extent 48.00 MiB
>   device-mapper: suspend ioctl on  failed: Device or resource busy
>   Unable to suspend lvm_vg-lvm_lv (253:0)
>   Failed to suspend origin lvm_lv
>   libdevmapper exiting with 2 device(s) still suspended.
> 
> 
> 
> 
> Why?

commit 18e9e5104fcd9a973ffe3eed3816c87f2a1b6cd2
Author: Josef Bacik <josef@redhat.com>
Date:   Tue Mar 23 10:34:56 2010 -0400

    Introduce freeze_super and thaw_super for the fsfreeze ioctl
    
    Currently the way we do freezing is by passing sb>s_bdev to freeze_bdev and the
    letting it do all the work.  But freezing is more of an fs thing, and doesn't
    really have much to do with the bdev at all, all the work gets done with the
    super.  In btrfs we do not populate s_bdev, since we can have multiple bdev's
    for one fs and setting s_bdev makes removing devices from a pool kind of tricky
    This means that freezing a btrfs filesystem fails, which causes us to corrupt
    with things like tux-on-ice which use the fsfreeze mechanism.  So instead of
    populating sb->s_bdev with a random bdev in our pool, I've broken the actual fs
    freezing stuff into freeze_super and thaw_super.  These just take the
    super_block that we're freezing and does the appropriate work.  It's basically
    just copy and pasted from freeze_bdev.  I've then converted freeze_bdev over to
    use the new super helpers.  I've tested this with ext4 and btrfs and verified
    everything continues to work the same as before.
    
    The only new gotcha is multiple calls to the fsfreeze ioctl will return EBUSY i
    the fs is already frozen.  I thought this was a better solution than adding a
    freeze counter to the super_block, but if everybody hates this idea I'm open to
    suggestions.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


IOWs, if you freeze the superblock via xfs_freeze or fsfreeze, you cannot nest freeze requests - you'll get EBUSY on teh second attempt to freeze the superblock. 

lvcreate must be doing a freeze from the block device, so it's failing with EBUSY because the superblock on the block device is already frozen...

-Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: xfs_freeze
  2014-06-19  6:46   ` 答复: xfs_freeze 陈文东
@ 2014-06-19  8:48     ` Emmanuel Florac
  2014-06-19 15:30       ` xfs_freeze Eric Sandeen
  0 siblings, 1 reply; 7+ messages in thread
From: Emmanuel Florac @ 2014-06-19  8:48 UTC (permalink / raw)
  To: 陈文东; +Cc: xfs

Le Thu, 19 Jun 2014 06:46:26 +0000 vous écriviez:

> What Would  Xfs Snapshot Do?
> 
> Xfs_freeze 

Apparently you should not run xfs_freeze first. Try "lvcreate -s"
directly.

regards,
-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

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

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

* Re: xfs_freeze
  2014-06-19  8:48     ` xfs_freeze Emmanuel Florac
@ 2014-06-19 15:30       ` Eric Sandeen
  2014-06-20  3:08         ` 答复: xfs_freeze 陈文东
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2014-06-19 15:30 UTC (permalink / raw)
  To: Emmanuel Florac, 陈文东; +Cc: xfs

On 6/19/14, 3:48 AM, Emmanuel Florac wrote:
> Le Thu, 19 Jun 2014 06:46:26 +0000 vous écriviez:
> 
>> What Would  Xfs Snapshot Do?
>>
>> Xfs_freeze 
> 
> Apparently you should not run xfs_freeze first. Try "lvcreate -s"
> directly.
> 
> regards,
> 

that's correct, lv snapshots do their own freezing.

-Eric

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

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

* 答复: xfs_freeze
  2014-06-19 15:30       ` xfs_freeze Eric Sandeen
@ 2014-06-20  3:08         ` 陈文东
  2014-06-24 16:10           ` Eric Sandeen
  0 siblings, 1 reply; 7+ messages in thread
From: 陈文东 @ 2014-06-20  3:08 UTC (permalink / raw)
  To: Eric Sandeen, Emmanuel Florac; +Cc: xfs

Hi:


[root@localhost ~]# 
[root@localhost ~]# mount -t xfs /dev/lvm_vg/lvm_lv /nas/
[root@localhost ~]# lvcreate  -s -L 40M -n cwd  /dev/lvm_vg/lvm_lv
  Rounding up size to full physical extent 48.00 MiB
  device-mapper: suspend ioctl on  failed: Device or resource busy
  Unable to suspend lvm_vg-lvm_lv (253:0)
  Failed to suspend origin lvm_lv
[root@localhost ~]#


What freezing ?
-----邮件原件-----
发件人: Eric Sandeen [mailto:sandeen@sandeen.net] 
发送时间: 2014年6月19日 23:31
收件人: Emmanuel Florac; 陈文东
抄送: xfs@oss.sgi.com
主题: Re: xfs_freeze

On 6/19/14, 3:48 AM, Emmanuel Florac wrote:
> Le Thu, 19 Jun 2014 06:46:26 +0000 vous écriviez:
> 
>> What Would  Xfs Snapshot Do?
>>
>> Xfs_freeze 
> 
> Apparently you should not run xfs_freeze first. Try "lvcreate -s"
> directly.
> 
> regards,
> 

that's correct, lv snapshots do their own freezing.

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

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

* Re: 答复: xfs_freeze
  2014-06-20  3:08         ` 答复: xfs_freeze 陈文东
@ 2014-06-24 16:10           ` Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-06-24 16:10 UTC (permalink / raw)
  To: 陈文东, Emmanuel Florac; +Cc: xfs

I don't know what might cause this; you may have to do some tracing
to find out who is returning -EBUSY.

-Eric

On 6/19/14, 10:08 PM, 陈文东 wrote:
> Hi:
> 
> 
> [root@localhost ~]# 
> [root@localhost ~]# mount -t xfs /dev/lvm_vg/lvm_lv /nas/
> [root@localhost ~]# lvcreate  -s -L 40M -n cwd  /dev/lvm_vg/lvm_lv
>   Rounding up size to full physical extent 48.00 MiB
>   device-mapper: suspend ioctl on  failed: Device or resource busy
>   Unable to suspend lvm_vg-lvm_lv (253:0)
>   Failed to suspend origin lvm_lv
> [root@localhost ~]#
> 
> 
> What freezing ?
> -----邮件原件-----
> 发件人: Eric Sandeen [mailto:sandeen@sandeen.net] 
> 发送时间: 2014年6月19日 23:31
> 收件人: Emmanuel Florac; 陈文东
> 抄送: xfs@oss.sgi.com
> 主题: Re: xfs_freeze
> 
> On 6/19/14, 3:48 AM, Emmanuel Florac wrote:
>> Le Thu, 19 Jun 2014 06:46:26 +0000 vous écriviez:
>>
>>> What Would  Xfs Snapshot Do?
>>>
>>> Xfs_freeze 
>>
>> Apparently you should not run xfs_freeze first. Try "lvcreate -s"
>> directly.
>>
>> regards,
>>
> 
> that's correct, lv snapshots do their own freezing.
> 
> -Eric
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

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

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

end of thread, other threads:[~2014-06-24 16:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19  5:09 xfs_freeze 陈文东
2014-06-19  5:42 ` xfs_freeze Dave Chinner
2014-06-19  6:46   ` 答复: xfs_freeze 陈文东
2014-06-19  8:48     ` xfs_freeze Emmanuel Florac
2014-06-19 15:30       ` xfs_freeze Eric Sandeen
2014-06-20  3:08         ` 答复: xfs_freeze 陈文东
2014-06-24 16:10           ` Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.