2001-07-18 01:27:26

by Anton Altaparmakov

[permalink] [raw]
Subject: [PATCH] 2.2.20-pre7 tiny NTFS fix

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;