aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/journal.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/journal.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/journal.c')
-rw-r--r--fs/reiserfs/journal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 0e30ba0ac489..bb05a3e51b93 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -240,7 +240,7 @@ static void cleanup_bitmap_list(struct super_block *p_s_sb,
240 if (jb->bitmaps == NULL) 240 if (jb->bitmaps == NULL)
241 return; 241 return;
242 242
243 for (i = 0; i < SB_BMAP_NR(p_s_sb); i++) { 243 for (i = 0; i < reiserfs_bmap_count(p_s_sb); i++) {
244 if (jb->bitmaps[i]) { 244 if (jb->bitmaps[i]) {
245 free_bitmap_node(p_s_sb, jb->bitmaps[i]); 245 free_bitmap_node(p_s_sb, jb->bitmaps[i]);
246 jb->bitmaps[i] = NULL; 246 jb->bitmaps[i] = NULL;
@@ -2734,7 +2734,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2734 journal->j_persistent_trans = 0; 2734 journal->j_persistent_trans = 0;
2735 if (reiserfs_allocate_list_bitmaps(p_s_sb, 2735 if (reiserfs_allocate_list_bitmaps(p_s_sb,
2736 journal->j_list_bitmap, 2736 journal->j_list_bitmap,
2737 SB_BMAP_NR(p_s_sb))) 2737 reiserfs_bmap_count(p_s_sb)))
2738 goto free_and_return; 2738 goto free_and_return;
2739 allocate_bitmap_nodes(p_s_sb); 2739 allocate_bitmap_nodes(p_s_sb);
2740 2740
@@ -2742,7 +2742,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2742 SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) = (old_format ? 2742 SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) = (old_format ?
2743 REISERFS_OLD_DISK_OFFSET_IN_BYTES 2743 REISERFS_OLD_DISK_OFFSET_IN_BYTES
2744 / p_s_sb->s_blocksize + 2744 / p_s_sb->s_blocksize +
2745 SB_BMAP_NR(p_s_sb) + 2745 reiserfs_bmap_count(p_s_sb) +
2746 1 : 2746 1 :
2747 REISERFS_DISK_OFFSET_IN_BYTES / 2747 REISERFS_DISK_OFFSET_IN_BYTES /
2748 p_s_sb->s_blocksize + 2); 2748 p_s_sb->s_blocksize + 2);