[PATCH] 2.2.20-pre7 tiny NTFS fix

From: Anton Altaparmakov (aia21@cus.cam.ac.uk)
Date: Tue Jul 17 2001 - 20:27:12 EST


Please apply attached patch for the next 2.2.20-pre release. It contains
a tiny ntfs fix to detect when the cluster size is too big and refuse to
mount the volume. (Without this patch the kernel panics which is not a
Good Thing and someone got anoyed enough with it to ask me to please fix

Patch is untested but considering it's a straight copy from 2.4 and it
passes a quick sanity check it should be fine.

Best regards,


Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

diff -urN linux-2.2.20-pre7-vanilla/fs/ntfs/fs.c linux-2.2.20-pre7-ntfs/fs/ntfs/fs.c --- linux-2.2.20-pre7-vanilla/fs/ntfs/fs.c Sun Mar 25 17:31:02 2001 +++ linux-2.2.20-pre7-ntfs/fs/ntfs/fs.c Wed Jul 18 02:18:44 2001 @@ -29,6 +29,7 @@ #include <linux/nls.h> #include <linux/locks.h> #include <linux/init.h> +#include <asm/page.h> /* Forward declarations */ static struct inode_operations ntfs_dir_inode_operations; @@ -941,6 +942,13 @@ brelse(bh); NTFS_SB(vol)=sb; ntfs_debug(DEBUG_OTHER, "Done to init volume\n"); + + /* Check the cluster size is within allowed blocksize limits. */ + if (vol->clustersize > PAGE_SIZE) { + ntfs_error("Partition cluster size is not supported yet (it " + "is > max kernel blocksize).\n"); + goto ntfs_read_super_unl; + } /* Inform the kernel that a device block is a NTFS cluster */ sb->s_blocksize=vol->clustersize; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:09 EST