In case of quick removal of loopback and adding another one it may
get same ID, confusing the cache system.
+2013-12-15 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/disk/loopback.c: Use sequential IDs rather than pointer.
+
+ In case of quick removal of loopback and adding another one it may
+ get same ID, confusing the cache system.
+
2013-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/acpi.c: Use grub_addr_t rather than long when
char *devname;
grub_file_t file;
struct grub_loopback *next;
+ unsigned long id;
};
static struct grub_loopback *loopback_list;
+static unsigned long last_id = 0;
static const struct grub_arg_option options[] =
{
}
newdev->file = file;
+ newdev->id = last_id++;
/* Add the new entry to the list. */
newdev->next = loopback_list;
disk->max_agglomerate = 1 << (29 - GRUB_DISK_SECTOR_BITS
- GRUB_DISK_CACHE_BITS);
- disk->id = (unsigned long) dev;
+ disk->id = dev->id;
disk->data = dev;