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 21:08:54 +0800 [thread overview]
Message-ID: <16a28a3b-7850-8a87-4649-c24aadb2600b@oracle.com> (raw)
In-Reply-To: <cb036707-14b7-578a-2051-56768a729771@suse.com>
> So I misread the code in the beginning, so the actual btrfs SB are being
> wiped out by the for loop which calls zer_dev_clamped. And in there all
> superblocks between 0 - block_count are zeored. And block_count is
> actual physical size of the device, right. And this value can further be
> limited by the max_block_count being passed, which in mkfs case is
> what's passed to -b.
>
> So instead of adding more code, why not just call zero_dev_clamped with
> the return value of btrfs_device_size rather than the possibly clamped
> one block_count? That you always unconditionally will be sure to zero
> out all the sb which are on the device, irrespective of the size of the
> fs? Something like :
Hm. Actually I didn't want to zero unless I find a valid SB at the
copy#2. I was kind of wanted suggestions if there is something that I am
missing if I write beyond the -b <blockcount>. I don't find anything
wrong though. I look at it as a kind of wipeall.
Thanks, Anand
prev parent reply other threads:[~2018-03-22 13:07 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
2018-03-22 12:25 ` Nikolay Borisov
2018-03-22 13:08 ` Anand Jain [this message]
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=16a28a3b-7850-8a87-4649-c24aadb2600b@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).