linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: wipe all copies of the stale superblock
Date: Thu, 22 Mar 2018 20:14:12 +0800	[thread overview]
Message-ID: <d2fbba43-dff3-3909-a794-69c4a8ed4ace@oracle.com> (raw)
In-Reply-To: <e16124c3-7f57-6a2f-f760-5164f7c10ad1@suse.com>



  Ok. Will update the change log.

> A better place for this code is really inside btrfs_wipe_existing_sb.
> Furthermore looking at libblkid it supports a way to wipe multiple
> superblocks by way of: blkid_do_wipe. I.e
> https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.21/libblkid-docs/libblkid-Low-level-tags.html#blkid-do-wipe
> 
> Apparently this functionality has been in libblkid for quite some time
> according to this blog post -
> http://karelzak.blogspot.bg/2011/11/wipefs8-improvements.html (Karel Zak
> is the person mainting various system libraries).
> 
> So can't we at the very least:
> 
> 1) Remove some of our (open coded) implementation of
> btrfs_wipe_existing_sb and use the generic blkid implementation.
> 
> 2) Incorporate your code into btrfs_wipe_existing_sb OR extend the usage
> of the generic blkid_do_wipe to wipe multiple copies of the sb ?

  In btrfs_prepare_device() we have already zeroed the SBs which were
  within the block count. The btrfs_wipe_existing_sb() is to handle the
  other type of FS SBs. Definitely, we can consolidate all this into a
  single function using libblkid. However, it can be done in a separate
  patch.

Thanks, Anand

  reply	other threads:[~2018-03-22 12:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 10:19 [PATCH] btrfs-progs: wipe all copies of the stale superblock Anand Jain
2018-03-21 12:53 ` Nikolay Borisov
2018-03-22 12:14   ` Anand Jain [this message]
2018-03-22 12:25     ` Nikolay Borisov
2018-03-22 13:08       ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2fbba43-dff3-3909-a794-69c4a8ed4ace@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).