On Thu, Sep 27, 2018 at 08:34:59PM +0200, Goffredo Baroncelli wrote:
> From: Goffredo Baroncelli <kreij...@inwind.it>
>
> Change the behavior of find_device(): before the patch, a read of a missed
> device may trigger a rescan. However, it is never recorded that a device
> is missed, so each single read of a missed device may triggers a rescan.
> It is the caller who decides if a rescan is performed in case of a missed
> device. And it does quite often, without considering if in the past a
> devices was already found as "missed"
> This behavior causes a lot of unneeded rescan, causing a huge slowdown in
> case of a missed device.
>
> After the patch, the "missed device" information is stored in the
> data->devices_attached[] array (as a NULL value in the field dev). A rescan
> is triggered only if no information at all is found. This means that only
> the first time a read of a missed device triggers a rescan.
>
> The change in the code is done removing "return NULL" when the disk is not
> found. So it is always executed the code which stores in the
> data->devices_attached[] array the value returned by grub_device_iterate():
> NULL if the device is missed, or a valid data otherwise.
>
> Signed-off-by: Goffredo Baroncelli <kreik...@inwind.it>

Commit message still begs for improvement. I will send you a proposal shortly.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to