linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 7/7] btrfs: drop the redundant invalidate_bdev()
Date: Fri, 30 Mar 2018 08:09:23 +0800	[thread overview]
Message-ID: <20180330000924.11148-8-anand.jain@oracle.com> (raw)
In-Reply-To: <20180330000924.11148-1-anand.jain@oracle.com>

During the mount context btrfs_open_devices() calls invalidate_bdev()
for all the devices. So drop the invalidate_bdev() in open_ctree()
which is only for the btrfs_fs_devices::latest_bdev.

The call trace is as shown below.

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)

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/disk-io.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 1eabcc4bf8d2..55b8a57435a9 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2553,8 +2553,6 @@ int open_ctree(struct super_block *sb,
 
 	__setup_root(tree_root, fs_info, BTRFS_ROOT_TREE_OBJECTID);
 
-	invalidate_bdev(fs_devices->latest_bdev);
-
 	/*
 	 * Read super block and check the signature bytes only
 	 */
-- 
2.7.0


  parent reply	other threads:[~2018-03-30  0:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  0:09 [PATCH v4 0/7] Superblock read and verify cleanups Anand Jain
2018-03-30  0:09 ` [PATCH 1/7] btrfs: cleanup btrfs_check_super_csum() for better code flow Anand Jain
2018-03-30  0:09 ` [PATCH v4 2/7] btrfs: return required error from btrfs_check_super_csum Anand Jain
2018-03-30  0:09 ` [PATCH v2 3/7] btrfs: cleanup btrfs_read_disk_super() to return std error Anand Jain
2018-03-30  0:09 ` [PATCH v2 4/7] btrfs: check if the fsid in the primary sb and copy sb are same Anand Jain
2018-03-30  0:09 ` [PATCH v4 5/7] btrfs: verify superblock checksum during scan Anand Jain
2018-03-30  0:09 ` [PATCH v2 6/7] btrfs: verify checksum for all devices in mount context Anand Jain
2018-03-30  0:09 ` Anand Jain [this message]
2018-04-10 14:48 ` [PATCH v4 0/7] Superblock read and verify cleanups David Sterba
2018-04-12  6:43   ` Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2018-03-29 10:36 [PATCH v3 0/9] " Anand Jain
2018-03-29 10:37 ` [PATCH 7/7] 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=20180330000924.11148-8-anand.jain@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).