[Ocfs2-tools-devel] [PATCH 02/14] fsck.ocfs2: fix journal tail wrapper

Junxiao Bi junxiao.bi at oracle.com
Tue Nov 15 16:18:50 PST 2016


On 11/15/2016 02:48 PM, piaojun wrote:
> Hi Junxiao,
> 
> Could you show me the way to reproduce this problem?
Please check the description in the patch log below to construct a
special transaction and then crash the kernel. Before this, enable fsck
on reboot for ocfs2 volume in /etc/fstab.

Thanks,
Junxiao.
> 
> On 2016-4-1 11:10, Junxiao Bi wrote:
>> If there is one transaction, its last block but one located at the
>> tail of the journal and its last commit block located at the head
>> of the journal, Crash the kernel and when fsck.ocfs2 -a run during
>> the reboot, the journal replay will fail due to the wrapper error.
>> This will make all the following transaction starting from the journal
>> head lost, and this will corrupt the fs.
>>
>> Acked-by: Srinivas Eeda <srinivas.eeda at oracle.com>
>> Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
>> ---
>>  fsck.ocfs2/journal.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/fsck.ocfs2/journal.c b/fsck.ocfs2/journal.c
>> index ff47633851f3..bc8465209097 100644
>> --- a/fsck.ocfs2/journal.c
>> +++ b/fsck.ocfs2/journal.c
>> @@ -339,6 +339,7 @@ static errcode_t replay_blocks(ocfs2_filesys *fs, struct journal_info *ji,
>>  			tagp += 16;
>>  	}
>>  	
>> +	*next_block = jwrap(ji->ji_jsb, *next_block);
>>  out:
>>  	if (io_buf)
>>  		ocfs2_free(&io_buf);
>>
> 




More information about the Ocfs2-tools-devel mailing list