[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] m68k: Atari GEMDOS FAT option fix: use correct logical sector size



Fix erroneous use of device blocksize instead of logical sector size in 
Atari GEMDOS FAT code (GEMDOS uses a 16 bit FAT and a constant 2 logical 
sectors per cluster, and modifies the logical sector size to cope with the 
limits imposed by the 16 bit FAT). The bug was probably introduced by me when 
porting this code forward from 2.4.
With this fix, I can successfully mount GEMDOS partitons up to 256 MB in size as 
prepared by Petr Stehlik. 512 MB require 8k sector size, sorry. 

Signed-off-by: Michael Schmitz <schmitz@debian.org>
---
 fs/fat/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 34dda7a..8156229 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1387,7 +1387,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 		 * it's a real MSDOS partition with 12-bit fat.
 		 */
 		if (sbi->fat_bits != 32 && total_clusters+2 > sbi->
-			fat_length*SECTOR_SIZE*8/sbi->fat_bits)
+			fat_length*sb->s_blocksize*8/sbi->fat_bits)
 			sbi->fat_bits = 12;
 		/* if it's a floppy disk --> 12bit fat */
 		if (sbi->fat_bits != 32 && MAJOR(sb->s_dev) == FLOPPY_MAJOR)
-- 
1.5.6.5


Reply to: