X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Ffat%2Finode.c;h=4e0a3dd9d6779a1d9101704d470b1263b194d7d5;hb=1df5a8d004f64b1aa3fb93e0556886ba00ebc979;hp=bf918929e793079ea5c5541a156a0e016726598b;hpb=73f20e58b1d586e9f6d3ddc3aad872829aca7743;p=linux-2.6 diff --git a/fs/fat/inode.c b/fs/fat/inode.c index bf918929e7..4e0a3dd9d6 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1222,11 +1222,10 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, brelse(bh); goto out_invalid; } - logical_sector_size = - le16_to_cpu(get_unaligned((__le16 *)&b->sector_size)); + logical_sector_size = get_unaligned_le16(&b->sector_size); if (!is_power_of_2(logical_sector_size) || (logical_sector_size < 512) - || (PAGE_CACHE_SIZE < logical_sector_size)) { + || (logical_sector_size > 4096)) { if (!silent) printk(KERN_ERR "FAT: bogus logical sector size %u\n", logical_sector_size); @@ -1322,8 +1321,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; sbi->dir_start = sbi->fat_start + sbi->fats * sbi->fat_length; - sbi->dir_entries = - le16_to_cpu(get_unaligned((__le16 *)&b->dir_entries)); + sbi->dir_entries = get_unaligned_le16(&b->dir_entries); if (sbi->dir_entries & (sbi->dir_per_block - 1)) { if (!silent) printk(KERN_ERR "FAT: bogus directroy-entries per block" @@ -1335,7 +1333,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, rootdir_sectors = sbi->dir_entries * sizeof(struct msdos_dir_entry) / sb->s_blocksize; sbi->data_start = sbi->dir_start + rootdir_sectors; - total_sectors = le16_to_cpu(get_unaligned((__le16 *)&b->sectors)); + total_sectors = get_unaligned_le16(&b->sectors); if (total_sectors == 0) total_sectors = le32_to_cpu(b->total_sect);