* grub-core/fs/minix.c (grub_minix_mount) [MODE_MINIX3]: Treat 0xffff

as 1024 in block size field. Found on one of my test images.
	Small optimisation while on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-25 22:44:42 +01:00
parent ec000eaca9
commit b2d004db18
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2011-12-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/minix.c (grub_minix_mount) [MODE_MINIX3]: Treat 0xffff
as 1024 in block size field. Found on one of my test images.
Small optimisation while on it.
2011-12-25 Vladimir Serbinenko <phcoder@gmail.com>
* docs/grub.texi (Filesystems): Mention SFS as Latin1 filesystem.

View file

@ -480,12 +480,18 @@ grub_minix_mount (grub_disk_t disk)
data->disk = disk;
data->linknest = 0;
#ifdef MODE_MINIX3
if ((grub_le_to_cpu16 (data->sblock.block_size)
& (grub_le_to_cpu16 (data->sblock.block_size) - 1))
|| grub_le_to_cpu16 (data->sblock.block_size) == 0)
/* These tests are endian-independent. No need to byteswap. */
if (data->sblock.block_size == 0xffff)
data->log_block_size = 10;
else
{
if ((data->sblock.block_size & (data->sblock.block_size - 1))
|| data->sblock.block_size == 0)
goto fail;
for (data->log_block_size = 0; (1 << data->log_block_size)
< grub_le_to_cpu16 (data->sblock.block_size); data->log_block_size++);
< grub_le_to_cpu16 (data->sblock.block_size);
data->log_block_size++);
}
#else
data->log_block_size = 10;
#endif