diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-07-25 09:44:53 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-07-25 10:29:21 -0400 |
commit | 89c0fd014d34d409a7b196667c2b9a4813b6c968 (patch) | |
tree | 9fad0ab3ce77b7537ed7d8db45c40e746e26692f /include | |
parent | 6cda9fa2575ec0869fe77b0bdf295c0e51868cab (diff) |
nilfs2: reject filesystem with unsupported block size
This inserts sanity check that refuses to mount a filesystem with
unsupported block size.
Previously, kernel code of nilfs was looking only limitation of
devices though mkfs.nilfs2 limits the range of block sizes; there was
no check that prevents rec_len overflow with larger block sizes.
With this change, block sizes larger than 64KB or smaller than 1KB
will get rejected explicitly by kernel.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nilfs2_fs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 970828a5ffc5..f5487b6f91ed 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
@@ -287,6 +287,12 @@ struct nilfs_super_block { | |||
287 | #define NILFS_NAME_LEN 255 | 287 | #define NILFS_NAME_LEN 255 |
288 | 288 | ||
289 | /* | 289 | /* |
290 | * Block size limitations | ||
291 | */ | ||
292 | #define NILFS_MIN_BLOCK_SIZE 1024 | ||
293 | #define NILFS_MAX_BLOCK_SIZE 65536 | ||
294 | |||
295 | /* | ||
290 | * The new version of the directory entry. Since V0 structures are | 296 | * The new version of the directory entry. Since V0 structures are |
291 | * stored in intel byte order, and the name_len field could never be | 297 | * stored in intel byte order, and the name_len field could never be |
292 | * bigger than 255 chars, it's safe to reclaim the extra byte for the | 298 | * bigger than 255 chars, it's safe to reclaim the extra byte for the |