after ten consecutive open failures. Scanning all the way up to
10000 is excessive and can cause serious performance problems in
some configurations.
Fixes Ubuntu bug #787461.
+2011-05-27 Colin Watson <cjwatson@ubuntu.com>
+
+ * grub-core/kern/emu/hostdisk.c (linux_find_partition): Give up
+ after ten consecutive open failures. Scanning all the way up to
+ 10000 is excessive and can cause serious performance problems in
+ some configurations.
+ Fixes Ubuntu bug #787461.
+
2011-05-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/arc/arcdisk.c (reopen): Close old handle before
int i;
char real_dev[PATH_MAX];
struct linux_partition_cache *cache;
+ int missing = 0;
strcpy(real_dev, dev);
fd = open (real_dev, O_RDONLY);
if (fd == -1)
- continue;
+ {
+ if (missing++ < 10)
+ continue;
+ else
+ return 0;
+ }
+ missing = 0;
close (fd);
start = find_partition_start (real_dev);