From ded1aa481644ce48e4933c40a7e66a6fc182bfd2 Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Wed, 6 Apr 2005 16:09:21 +0100 Subject: [PATCH] --- yaml --- r: 4863 b: refs/heads/master c: 7fafb8b634121f4fa35ff92f85737f8bc2259f06 h: refs/heads/master i: 4861: 3188bcc1ef950b6abc61bc3005c84939885ec903 4859: 2ff81ba9464459296cc6f8c33780f06f27631501 4855: 58681fd78c404b52e7e363c3012a8445bd743cc4 4847: bf71036be72f43866c8bc8f55cd6d8af9bbe1591 4831: ac9efee298dc102415889dddfb133f404017f8bd 4799: 26d5edac824e7f553bd499ebd2a04d799ab24cd2 4735: 0dab57f216cc970b98bdf74adf1548898ce003e0 4607: c5f1070f819c72aad2a902b7b9a141824c11c9e4 v: v3 --- [refs] | 2 +- trunk/fs/ntfs/ChangeLog | 2 ++ trunk/fs/ntfs/ntfs.h | 3 +++ trunk/fs/ntfs/super.c | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index bea055aafc1a..542da74db216 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bb3cf33509009132cf8c7a7729f9d26c0c5fa961 +refs/heads/master: 7fafb8b634121f4fa35ff92f85737f8bc2259f06 diff --git a/trunk/fs/ntfs/ChangeLog b/trunk/fs/ntfs/ChangeLog index 52f868a9662b..788e3bd2528b 100644 --- a/trunk/fs/ntfs/ChangeLog +++ b/trunk/fs/ntfs/ChangeLog @@ -111,6 +111,8 @@ ToDo/Notes: refusing the mount. Thanks to Bernd Casimir for pointing this problem out. - Update attribute definition handling. + - Add NTFS_MAX_CLUSTER_SIZE and NTFS_MAX_PAGES_PER_CLUSTER constants. + - Use NTFS_MAX_CLUSTER_SIZE in super.c instead of hard coding 0x10000. 2.1.22 - Many bug and race fixes and error handling improvements. diff --git a/trunk/fs/ntfs/ntfs.h b/trunk/fs/ntfs/ntfs.h index e85f6e928b1e..446b5014115c 100644 --- a/trunk/fs/ntfs/ntfs.h +++ b/trunk/fs/ntfs/ntfs.h @@ -31,6 +31,7 @@ #include #include #include +#include #include "types.h" #include "volume.h" @@ -42,6 +43,8 @@ typedef enum { NTFS_SB_MAGIC = 0x5346544e, /* 'NTFS' */ NTFS_MAX_NAME_LEN = 255, NTFS_MAX_ATTR_NAME_LEN = 255, + NTFS_MAX_CLUSTER_SIZE = 64 * 1024, /* 64kiB */ + NTFS_MAX_PAGES_PER_CLUSTER = NTFS_MAX_CLUSTER_SIZE / PAGE_CACHE_SIZE, } NTFS_CONSTANTS; /* Global variables. */ diff --git a/trunk/fs/ntfs/super.c b/trunk/fs/ntfs/super.c index 6f752ea765c3..8e50aa929f1c 100644 --- a/trunk/fs/ntfs/super.c +++ b/trunk/fs/ntfs/super.c @@ -561,9 +561,9 @@ static BOOL is_boot_sector_ntfs(const struct super_block *sb, default: goto not_ntfs; } - /* Check the cluster size is not above 65536 bytes. */ + /* Check the cluster size is not above the maximum (64kiB). */ if ((u32)le16_to_cpu(b->bpb.bytes_per_sector) * - b->bpb.sectors_per_cluster > 0x10000) + b->bpb.sectors_per_cluster > NTFS_MAX_CLUSTER_SIZE) goto not_ntfs; /* Check reserved/unused fields are really zero. */ if (le16_to_cpu(b->bpb.reserved_sectors) || @@ -2585,7 +2585,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) */ kmem_cache_t *ntfs_name_cache; -/* Slab caches for efficient allocation/deallocation of of inodes. */ +/* Slab caches for efficient allocation/deallocation of inodes. */ kmem_cache_t *ntfs_inode_cache; kmem_cache_t *ntfs_big_inode_cache;