From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 6/8] btrfs: verify superblock checksum during scan
Date: Thu, 29 Mar 2018 18:17:41 +0800 [thread overview]
Message-ID: <a406e066-c30e-d060-9627-d5666257ed75@oracle.com> (raw)
In-Reply-To: <13c339bb-1beb-45e0-6504-dde4d2e806b5@suse.com>
On 03/28/2018 03:21 PM, Nikolay Borisov wrote:
>
>
> On 28.03.2018 02:39, Anand Jain wrote:
>> During the scan context, we aren't verifying the superblock-
>> checksum when read.
>> This patch fixes it by adding the checksum verification function
>> btrfs_check_super_csum() in the function btrfs_read_disk_super().
>> And makes device scan to error fail if the primary superblock csum
>> is wrong, whereas if the copy-superblock csum is wrong it will just
>> just report mismatch and continue mount/scan as usual. When the
>
> Where in this patch do you deal with the secondary sb.
> btrfs_read_disk_super verifies only the primary sb which corresponds to
> the first part of the sentence. But I'm confused about the second?
btrfs_read_disk_super() actaully reads and csum verifies the copy_num
as provided.
bytenr = btrfs_sb_offset(copy_num);
> I also think that 4/8 should be merged into this one.
Right. I can do that.
Thanks, Anand
next prev parent reply other threads:[~2018-03-29 10:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 23:39 [PATCH v2 0/9] Superblock read and verify cleanups Anand Jain
2018-03-27 23:39 ` [PATCH 1/8] btrfs: cleanup btrfs_check_super_csum() for better code flow Anand Jain
2018-03-27 23:39 ` [PATCH v2 2/8] btrfs: return required error from btrfs_check_super_csum Anand Jain
2018-03-27 23:39 ` [PATCH v2 3/8] btrfs: cleanup btrfs_read_disk_super() to return std error Anand Jain
2018-03-28 7:05 ` Nikolay Borisov
2018-03-27 23:39 ` [PATCH 4/8] btrfs: make btrfs_check_super_csum() non-static Anand Jain
2018-03-27 23:39 ` [PATCH v2 5/8] btrfs: check if the fsid in the primary sb and copy sb are same Anand Jain
2018-03-28 7:10 ` Nikolay Borisov
2018-03-29 10:18 ` Anand Jain
2018-03-27 23:39 ` [PATCH v2 6/8] btrfs: verify superblock checksum during scan Anand Jain
2018-03-28 7:21 ` Nikolay Borisov
2018-03-29 10:17 ` Anand Jain [this message]
2018-03-27 23:39 ` [PATCH v2 7/8] btrfs: verify checksum for all devices in mount context Anand Jain
2018-03-27 23:39 ` [PATCH 8/8] btrfs: drop the redundant invalidate_bdev() 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=a406e066-c30e-d060-9627-d5666257ed75@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).