提交 7aff8cf4 编写于 作者: Z Zhao Lei 提交者: David Sterba

btrfs: reada: ignore creating reada_extent for a non-existent device

For a non-existent device, old code bypasses adding it in dev's reada
queue.

And to solve problem of unfinished waitting in raid5/6,
commit 5fbc7c59 ("Btrfs: fix unfinished readahead thread for
raid5/6 degraded mounting")
adding an exception for the first stripe, in short, the first
stripe will always be processed whether the device exists or not.

Actually we have a better way for the above request: just bypass
creation of the reada_extent for non-existent device, it will make
code simple and effective.
Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 4fe7a0e1
...@@ -371,6 +371,11 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root, ...@@ -371,6 +371,11 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
struct reada_zone *zone; struct reada_zone *zone;
dev = bbio->stripes[nzones].dev; dev = bbio->stripes[nzones].dev;
/* cannot read ahead on missing device. */
if (!dev->bdev)
continue;
zone = reada_find_zone(fs_info, dev, logical, bbio); zone = reada_find_zone(fs_info, dev, logical, bbio);
if (!zone) if (!zone)
continue; continue;
...@@ -423,15 +428,9 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root, ...@@ -423,15 +428,9 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
*/ */
continue; continue;
} }
if (!dev->bdev) { if (!dev->bdev)
/* continue;
* cannot read ahead on missing device, but for RAID5/6,
* REQ_GET_READ_MIRRORS return 1. So don't skip missing
* device for such case.
*/
if (nzones > 1)
continue;
}
if (dev_replace_is_ongoing && if (dev_replace_is_ongoing &&
dev == fs_info->dev_replace.tgtdev) { dev == fs_info->dev_replace.tgtdev) {
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册