aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/super.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2007-10-19 02:39:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:35 -0400
commitcb680c1be62e9898fc2ca2a89d9fdba7c84a5c81 (patch)
tree967eba31bdb120305697f5d0292964abead07962 /fs/reiserfs/super.c
parent4d20851d3757ba5bece263a4c8c5a2bd4983cb5d (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 'fs/reiserfs/super.c')
-rw-r--r--fs/reiserfs/super.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index b82897ae090b..57adfe90d5ae 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1725,6 +1725,21 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1725 set_sb_umount_state(rs, REISERFS_ERROR_FS); 1725 set_sb_umount_state(rs, REISERFS_ERROR_FS);
1726 set_sb_fs_state(rs, 0); 1726 set_sb_fs_state(rs, 0);
1727 1727
1728 /* Clear out s_bmap_nr if it would wrap. We can handle this
1729 * case, but older revisions can't. This will cause the
1730 * file system to fail mount on those older implementations,
1731 * avoiding corruption. -jeffm */
1732 if (bmap_would_wrap(reiserfs_bmap_count(s)) &&
1733 sb_bmap_nr(rs) != 0) {
1734 reiserfs_warning(s, "super-2030: This file system "
1735 "claims to use %u bitmap blocks in "
1736 "its super block, but requires %u. "
1737 "Clearing to zero.", sb_bmap_nr(rs),
1738 reiserfs_bmap_count(s));
1739
1740 set_sb_bmap_nr(rs, 0);
1741 }
1742
1728 if (old_format_only(s)) { 1743 if (old_format_only(s)) {
1729 /* filesystem of format 3.5 either with standard or non-standard 1744 /* filesystem of format 3.5 either with standard or non-standard
1730 journal */ 1745 journal */