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 actua

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: > >

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. > > > > Cl

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 functional

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 [ ...]", > > FYI, this step is named 'clear superblock' in kernel code as done aft

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 constan

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 [ ...]", FYI, this step is named 'clear superblock' in kernel code as done after the device is removed, and I suggest to consider to name the c

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

2012-05-01 Thread Hubert Kario
Signed-off-by: Hubert Kario diff --git a/cmds-device.c b/cmds-device.c index db625a6..05a549c 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -246,11 +246,58 @@ static int cmd_scan_dev(int argc, char **argv) return 0; } +static const char * const cmd_zero_dev_usage[] = { + "btr