From 0bcaa65a56ab74003666cf741b0bfa1e9263a11c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 10 Aug 2010 18:03:33 -0700 Subject: fs/sysv: v7: adjust sanity checks for some volumes Newly mkfs-ed filesystems from Seventh Edition have last modification time set to zero, but are otherwise perfectly valid. Also, tighten up other sanity checks to filter out most filesystems with [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Lubomir Rintel Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sysv_fs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/sysv_fs.h') diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index 96411306eec6..e47d6d90023d 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -148,6 +148,17 @@ struct v7_super_block { char s_fname[6]; /* file system name */ char s_fpack[6]; /* file system pack name */ }; +/* Constants to aid sanity checking */ +/* This is not a hard limit, nor enforced by v7 kernel. It's actually just + * the limit used by Seventh Edition's ls, though is high enough to assume + * that no reasonable file system would have that much entries in root + * directory. Thus, if we see anything higher, we just probably got the + * endiannes wrong. */ +#define V7_NFILES 1024 +/* The disk addresses are three-byte (despite direct block addresses being + * aligned word-wise in inode). If the most significant byte is non-zero, + * something is most likely wrong (not a filesystem, bad bytesex). */ +#define V7_MAXSIZE 0x00ffffff /* Coherent super-block data on disk */ #define COH_NICINOD 100 /* number of inode cache entries */ -- cgit v1.2.3