linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.2.20-pre7 tiny NTFS fix
@ 2001-07-18  1:27 Anton Altaparmakov
  0 siblings, 0 replies; only message in thread
From: Anton Altaparmakov @ 2001-07-18  1:27 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 626 bytes --]

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/

[-- Attachment #2: Type: TEXT/PLAIN, Size: 902 bytes --]

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-07-18  1:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-18  1:27 [PATCH] 2.2.20-pre7 tiny NTFS fix Anton Altaparmakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).