diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-11-08 16:16:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 09:20:21 +0100 |
commit | ff874d5243276a2bbac55be55cd38c189f57d6a7 (patch) | |
tree | c2fd21c4898cdcff856dcf113e35291bdb3b49af /fs/btrfs/dev-replace.c | |
parent | 1cfc35d0deac4534e0e3c6df130863d7bd9ee90f (diff) |
btrfs: Check for missing device before bio submission in btrfs_map_bio
[ Upstream commit fc8a168aa9ab1680c2bd52bf9db7c994e0f2524f ]
Before btrfs_map_bio submits all stripe bios it does a number of checks
to ensure the device for every stripe is present. However, it doesn't do
a DEV_STATE_MISSING check, instead this is relegated to the lower level
btrfs_schedule_bio (in the async submission case, sync submission
doesn't check DEV_STATE_MISSING at all). Additionally
btrfs_schedule_bios does the duplicate device->bdev check which has
already been performed in btrfs_map_bio.
This patch moves the DEV_STATE_MISSING check in btrfs_map_bio and
removes the duplicate device->bdev check. Doing so ensures that no bio
cloning/submission happens for both async/sync requests in the face of
missing device. This makes the async io submission path slightly shorter
in terms of instruction count. No functional changes.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions