Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-09 Thread David Sterba
On Thu, May 03, 2012 at 03:11:45PM +0200, Hubert Kario wrote: nice, didn't know about this. Such functionality would be nice to have. But then I don't think that a recreate the array if the parameters are the same is actually a good idea, lots of space for error. A pair of functions: btrfs

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-09 Thread Hubert Kario
On Wednesday 09 of May 2012 19:18:07 David Sterba wrote: On Thu, May 03, 2012 at 03:11:45PM +0200, Hubert Kario wrote: nice, didn't know about this. Such functionality would be nice to have. But then I don't think that a recreate the array if the parameters are the same is actually a good

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-03 Thread Hubert Kario
On Wednesday 02 of May 2012 19:36:29 David Sterba wrote: On Wed, May 02, 2012 at 06:42:16PM +0200, Hubert Kario wrote: I'm not sure if this is useful and sensible usecase, clearing superblock is a one-time action anyway, so it's more for the sake of tool flexibility. Clearing

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-02 Thread David Sterba
On Tue, May 01, 2012 at 02:40:29PM +0200, Hubert Kario wrote: +static const char * const cmd_zero_dev_usage[] = { + btrfs device zero-superblock device [device ...], FYI, this step is named 'clear superblock' in kernel code as done after the device is removed, and I suggest to consider to

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-02 Thread David Sterba
On Wed, May 02, 2012 at 04:28:43PM +0200, David Sterba wrote: I had prototyped a similar utility (in perl, so nothing for progs inclusion for now) attached. david #!/usr/bin/perl # clear btrfs signature from a device use Fcntl; use constant BTRFS_SUPER_INFO_OFFSET = 64 * 1024; use constant

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-02 Thread Hubert Kario
On Wednesday 02 of May 2012 16:28:43 David Sterba wrote: On Tue, May 01, 2012 at 02:40:29PM +0200, Hubert Kario wrote: +static const char * const cmd_zero_dev_usage[] = { + btrfs device zero-superblock device [device ...], FYI, this step is named 'clear superblock' in kernel code as done

Re: [PATCH v2 1/5] btrfs: add command to zero out superblock

2012-05-02 Thread David Sterba
On Wed, May 02, 2012 at 06:42:16PM +0200, Hubert Kario wrote: A similar function in mdadm is called zero superblock so I just re used the name (according to the principle of least surprise). Users, even admins, generally don't read kernel code... I intended to point out that the