]> git.ipfire.org Git - thirdparty/grub.git/commit
btrfs: Avoid a rescan for a device which was already not found
authorGoffredo Baroncelli <kreijack@inwind.it>
Mon, 22 Oct 2018 17:29:34 +0000 (19:29 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 31 Oct 2018 10:44:55 +0000 (11:44 +0100)
commitfd5a1d82f1d6a0482f5fe201ce646ddba8574bab
tree6fa94e70d5c0e3af52858ff409dd2ab9957e7beb
parent908cdb1d029e27f8059f9e3571e8dcbd67f74d8a
btrfs: Avoid a rescan for a device which was already not found

Currently read from missing device triggers rescan. However, it is never
recorded that the device is missing. So, each read of a missing device
triggers rescan again and again. This behavior causes a lot of unneeded
rescans leading to huge slowdowns.

This patch fixes above mentioned issue. Information about missing devices
is stored in the data->devices_attached[] array as NULL value in dev
member. Rescan is triggered only if no information is found for a given
device. This means that only first time read triggers rescan.

The patch drops premature return. This way data->devices_attached[] is
filled even when a given device is missing.

Signed-off-by: Goffredo Baroncelli <kreikack@inwind.it>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/btrfs.c