diff options
author | Jeff Mahoney <jeffm@suse.com> | 2007-10-19 02:39:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:35 -0400 |
commit | cb680c1be62e9898fc2ca2a89d9fdba7c84a5c81 (patch) | |
tree | 967eba31bdb120305697f5d0292964abead07962 /include | |
parent | 4d20851d3757ba5bece263a4c8c5a2bd4983cb5d (diff) |
reiserfs: ignore on disk s_bmap_nr value
Implement support for file systems larger than 8 TiB.
The reiserfs superblock contains a 16 bit value for counting the number of
bitmap blocks. The rest of the disk format supports file systems up to 2^32
blocks, but the bitmap block limitation artificially limits this to 8 TiB with
a 4KiB block size.
Rather than trust the superblock's 16-bit bitmap block count, we calculate it
dynamically based on the number of blocks in the file system. When an
incorrect value is observed in the superblock, it is zeroed out, ensuring that
older kernels will not be able to mount the file system.
Userspace support has already been implemented and shipped in reiserfsprogs
3.6.20.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/reiserfs_fs.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 69a3e12cb8c8..d8653bf232e3 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -283,6 +283,18 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb) | |||
283 | return sb->s_fs_info; | 283 | return sb->s_fs_info; |
284 | } | 284 | } |
285 | 285 | ||
286 | /* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 | ||
287 | * which overflows on large file systems. */ | ||
288 | static inline u32 reiserfs_bmap_count(struct super_block *sb) | ||
289 | { | ||
290 | return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; | ||
291 | } | ||
292 | |||
293 | static inline int bmap_would_wrap(unsigned bmap_nr) | ||
294 | { | ||
295 | return bmap_nr > ((1LL << 16) - 1); | ||
296 | } | ||
297 | |||
286 | /** this says about version of key of all items (but stat data) the | 298 | /** this says about version of key of all items (but stat data) the |
287 | object consists of */ | 299 | object consists of */ |
288 | #define get_inode_item_key_version( inode ) \ | 300 | #define get_inode_item_key_version( inode ) \ |