* 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.
This commit is contained in:
parent
245f4aba48
commit
c64db050f7
2 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
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>
|
2011-05-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/disk/arc/arcdisk.c (reopen): Close old handle before
|
* grub-core/disk/arc/arcdisk.c (reopen): Close old handle before
|
||||||
|
|
|
@ -564,6 +564,7 @@ linux_find_partition (char *dev, grub_disk_addr_t sector)
|
||||||
int i;
|
int i;
|
||||||
char real_dev[PATH_MAX];
|
char real_dev[PATH_MAX];
|
||||||
struct linux_partition_cache *cache;
|
struct linux_partition_cache *cache;
|
||||||
|
int missing = 0;
|
||||||
|
|
||||||
strcpy(real_dev, dev);
|
strcpy(real_dev, dev);
|
||||||
|
|
||||||
|
@ -602,7 +603,13 @@ linux_find_partition (char *dev, grub_disk_addr_t sector)
|
||||||
|
|
||||||
fd = open (real_dev, O_RDONLY);
|
fd = open (real_dev, O_RDONLY);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
continue;
|
{
|
||||||
|
if (missing++ < 10)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
missing = 0;
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
start = find_partition_start (real_dev);
|
start = find_partition_start (real_dev);
|
||||||
|
|
Loading…
Add table
Reference in a new issue