From: adilger Date: Thu, 3 Oct 2002 05:37:28 +0000 (+0000) Subject: Fix problems if ext3 and extN have different sb_info structs. X-Git-Tag: v1_7_100~4624 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=521dc4e8b91dc048246a97f3a1396e2273ad29d2 Fix problems if ext3 and extN have different sb_info structs. --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 60a51ff..538bc1c 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -851,6 +852,7 @@ static int ext3_credits_needed(struct super_block *sb, int objcount, needed += nindir; } + /* Assumes ext3 and extN have same sb_info layout at the start. */ if (nbitmaps > EXT3_SB(sb)->s_groups_count) nbitmaps = EXT3_SB(sb)->s_groups_count; if (ngdblocks > EXT3_SB(sb)->s_gdb_count) @@ -891,10 +893,14 @@ static void *ext3_filter_journal_start(struct filter_obd *filter, handle_t *handle = NULL; int needed; - /* Assumes ext3 and extN have same sb_info layout, but avoids issues - * with having extN built properly before filterobd for now. + /* It appears that some kernels have different values for + * EXT*_MAX_GROUP_LOADED (either 8 or 32), so we cannot + * assume anything after s_inode_bitmap_number is the same. */ - journal = EXT3_SB(filter->fo_sb)->s_journal; + if (!strcmp(filter->fo_fstype, "ext3")) + journal = EXT3_SB(filter->fo_sb)->s_journal; + else if (!strcmp(filter->fo_fstype, "extN")) + journal = EXTN_SB(filter->fo_sb)->s_journal; needed = ext3_credits_needed(filter->fo_sb, objcount, obj); /* The number of blocks we could _possibly_ dirty can very large.