[Ocfs2-tools-devel][PATCH] Add test script in ocfs2-test to check
the wrong incompat flag set by tunefs.ocfs2.
Sunil Mushran
Sunil.Mushran at oracle.com
Mon Sep 24 14:29:56 PDT 2007
Don't you think it will be better if you checked for TUNEFS_INPROG.
Either way... sob.
tao.ma wrote:
> Add test script in ocfs2-test to check the wrong incompat flag set by
> tunefs.ocfs2.
> Mark Fasheh wrote:
>> opts.num_slots is initialized to zero, which is always less than
>> max_slots
>> on a valid ocfs2 file system. If tunefs.ocfs2 is called at all for
>> anything,
>> even without "-N" the test for setting the removing-slots incompat flag
>> succeeds because it's not explicitely checking for zero.
>>
>> This means that simple operations like changing mount type leave the
>> incompat bit set in the super block, rendering the file system
>> unmountable
>> until fsck.ocfs2 is run.
>>
>> Signed-off-by: Mark Fasheh <mark.fasheh at oracle.com>
>> ---
>> tunefs.ocfs2/tunefs.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
>> index 4bb9f82..fbdb9e3 100644
>> --- a/tunefs.ocfs2/tunefs.c
>> +++ b/tunefs.ocfs2/tunefs.c
>> @@ -1452,7 +1452,8 @@ int main(int argc, char **argv)
>> }
>>
>> /* Set resize incompat flag on superblock */
>> - if (opts.num_blocks || opts.num_slots < max_slots) {
>> + if (opts.num_blocks ||
>> + (opts.num_slots && opts.num_slots < max_slots)) {
>> if (opts.num_blocks)
>> OCFS2_RAW_SB(fs->fs_super)->s_feature_incompat |=
>> OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG;
>>
> <http://www.oracle.com/cdc/>
> ------------------------------------------------------------------------
>
> Index: programs/tunefs-test/remove-slot/remove_slot.sh
> ===================================================================
> --- programs/tunefs-test/remove-slot/remove_slot.sh (revision 138)
> +++ programs/tunefs-test/remove-slot/remove_slot.sh (working copy)
> @@ -261,6 +261,11 @@ function normal_test()
> $FSCK_BIN -f $DEVICE|sed -e '/slots/ d'>$FSCK_OUTPUT
> diff $FSCK_OUTPUT $FSCK_OUTPUT_STANDARD
> exit_if_bad $? "0" "fsck find errors after decrease slot to $slot_num." $LINENO
> +
> + #check whether the Incompat flag will affect other operations.
> + echo "y"|$TUNEFS_BIN -M local $DEVICE
> + $DEBUGFS_BIN -R "stats" $DEVICE|grep "RemoveSlot"
> + exit_if_bad $? "1" "RemoveSlot Incompat flag exist in other operations."
> }
>
> ################################################################
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
More information about the Ocfs2-tools-devel
mailing list