From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/2] verify superblock checksum
Date: Mon, 26 Mar 2018 14:34:11 +0800 [thread overview]
Message-ID: <490278d6-cf1d-53ca-ad96-8ec08684abd0@oracle.com> (raw)
In-Reply-To: <20180323125349.26893-1-anand.jain@oracle.com>
Pls ignore this set as I am including these patches
in the bigger set.
Thanks, Anand
On 03/23/2018 08:53 PM, Anand Jain wrote:
> Here are the threads/context [1] in which we read the superblock(s).
> And this patchset will make sure the superblock csum are checked
> when they are read in the respective context as show below [1].
>
> This patchset is on top of
> [PATCH v2.1] btrfs: check if the fsid in the primary sb and copy sb are same
> which is on top of
> [PATCH 0/3] Preparatory to add the csum check in the scan context
>
> [1]
>
> A. dev delete/replace
> (its would have been better if we had just used uuid from the userland,
> reading the superblock does not make sense to me, but for legacy purpose
> we have to continue to support its ioctl args.).
>
> btrfs_rm_device() || btrfs_dev_replace_by_ioctl()
> |_btrfs_find_device_by_devspec()
> |_btrfs_find_device_missing_or_by_path()
> |_btrfs_find_device_by_path()
> |_btrfs_get_bdev_and_sb()
> |_btrfs_read_dev_super()
> |_btrfs_read_dev_one_super()
> |___bread()
>
> B. mount
>
> btrfs_mount_root()
> |
> |_btrfs_parse_early_options (-o device only)
> | |_btrfs_scan_one_device
> | |_btrfs_read_disk_super()
> | |_read_cache_page_gfp()
> |
> |_btrfs_scan_one_device(mount-arg-dev only)
> | |_btrfs_read_disk_super()
> | |_read_cache_page_gfp()
> |
> |
> |_btrfs_open_devices(fsid:all)
> | |_btrfs_open_one_device()
> | |_btrfs_get_bdev_and_sb() <--- invalidate_bdev(fsid:all)
> | |_btrfs_read_dev_super()
> | |_btrfs_read_dev_one_super()
> | |___bread()
> |
> |_btrfs_fill_super()
> |_btrfs_open_ctree() <-- invalidate_bdev(latest_bdev) <-- redundant
> |_btrfs_read_dev_super(latest_bdev only)
> | |_btrfs_read_dev_one_super(latest_bdev only)
> | |___bread(latest_bdev)
> |
> |_btrfs_check_super_csum(latest_bdev only) [*]
> |
> |_btrfs_read_chunk_tree
> |_read_one_dev()
> |_open_seed_devices()
> |_btrfs_open_devices(fs_devices->seed only)
>
> C. scan/ready
>
> scan/ready
> |_btrfs_scan_one_device(ioctl-arg-dev only)
> |_btrfs_read_disk_super()
> |_read_cache_page_gfp()
>
>
> Anand Jain (2):
> btrfs: verify checksum when superblock is read for mount
> btrfs: verify checksum when superblock is read for scan
>
> fs/btrfs/disk-io.c | 35 ++++++++++++++++++-----------------
> fs/btrfs/disk-io.h | 1 +
> fs/btrfs/volumes.c | 32 +++++++++++++++++++++++---------
> 3 files changed, 42 insertions(+), 26 deletions(-)
>
prev parent reply other threads:[~2018-03-26 6:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 12:53 [PATCH 0/2] verify superblock checksum Anand Jain
2018-03-23 12:53 ` [PATCH 1/2] btrfs: verify checksum when superblock is read for mount Anand Jain
2018-03-23 12:53 ` [PATCH 2/2] btrfs: verify checksum when superblock is read for scan Anand Jain
2018-03-26 6:34 ` 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=490278d6-cf1d-53ca-ad96-8ec08684abd0@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/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).