[Ocfs2-tools-devel] [PATCH] mkfs.ocfs2: release memory before mkfs.ocfs2 exit
Jia Guo
guojia12 at huawei.com
Sun Jan 27 17:34:01 PST 2019
On 2019/1/28 9:23, piaojun wrote:
> Hi Jia
>
> It seems that fs needs also to be released in format_backup_super():
> finish_normal_format
> format_backup_super
> exit(1)
>
> Thanks,
> Jun
OK, I will review the code to make sure that nothing is missing.
Thanks,
Jia
>
> On 2019/1/25 15:42, Jia Guo wrote:
>> Release memory before mkfs.ocfs2 exit.
>>
>> Signed-off-by: Jia Guo <guojia12 at huawei.com>
>> ---
>> mkfs.ocfs2/mkfs.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
>> index 932b905..4a0f741 100644
>> --- a/mkfs.ocfs2/mkfs.c
>> +++ b/mkfs.ocfs2/mkfs.c
>> @@ -439,6 +439,7 @@ static void format_quota_files(State *s, ocfs2_filesys *fs)
>> return;
>> error:
>> clear_both_ends(s);
>> + ocfs2_close(fs);
>> exit(1);
>> }
>>
>> @@ -461,6 +462,7 @@ static void grow_extent_allocator(State *s, ocfs2_filesys *fs)
>>
>> error:
>> clear_both_ends(s);
>> + ocfs2_close(fs);
>> exit(1);
>> }
>>
>> @@ -3117,6 +3119,7 @@ static void create_lost_found_dir(State *s, ocfs2_filesys *fs)
>>
>> bail:
>> clear_both_ends(s);
>> + ocfs2_close(fs);
>> exit(1);
>> }
>>
>> @@ -3161,6 +3164,7 @@ static void format_journals(State *s, ocfs2_filesys *fs)
>>
>> error:
>> clear_both_ends(s);
>> + ocfs2_close(fs);
>> exit(1);
>> }
>>
>> @@ -3172,6 +3176,7 @@ static void format_slotmap(State *s, ocfs2_filesys *fs)
>> if (ret) {
>> com_err(s->progname, ret, "while formatting the slot map");
>> clear_both_ends(s);
>> + ocfs2_close(fs);
>> exit(1);
>> }
>> }
>>
>>
>> _______________________________________________
>> Ocfs2-tools-devel mailing list
>> Ocfs2-tools-devel at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
>>
> .
>
More information about the Ocfs2-tools-devel
mailing list