patch-2.1.89 linux/fs/fat/file.c

Next file: linux/fs/fat/mmap.c
Previous file: linux/fs/exec.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.88/linux/fs/fat/file.c linux/fs/fat/file.c
@@ -105,7 +105,7 @@
 	NULL,			/* rename */
 	NULL,			/* readlink */
 	NULL,			/* follow_link */
-	NULL,			/* readpage */
+	generic_readpage,	/* readpage */
 	NULL,			/* writepage */
 	NULL,			/* bmap */
 	fat_truncate,		/* truncate */
@@ -317,7 +317,13 @@
 		return MSDOS_SB(inode->i_sb)->cvf_format
 			->cvf_file_read(filp,buf,count,ppos);
 
-	if (!MSDOS_I(inode)->i_binary)
+	/*
+	 * MS-DOS filesystems with a blocksize > 512 may have blocks
+	 * spread over several hardware sectors (unaligned), which
+	 * is not something the generic routines can (or would want
+	 * to) handle).
+	 */
+	if (!MSDOS_I(inode)->i_binary || inode->i_sb->s_blocksize > 512)
 		return fat_file_read_text(filp, buf, count, ppos);
 	return generic_file_read(filp, buf, count, ppos);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov