Messages in this thread Patch in this message |  | | Date | Wed, 18 Jul 2001 02:27:12 +0100 (BST) | | From | Anton Altaparmakov <> | | Subject | [PATCH] 2.2.20-pre7 tiny NTFS fix |
| |
Alan,
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 it...)
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 -- 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; |  |