All of lore.kernel.org
 help / color / mirror / Atom feed
From: piaojun <piaojun@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: fix panic due to unrecovered local alloc
Date: Mon, 19 Nov 2018 09:52:00 +0800	[thread overview]
Message-ID: <5BF21740.5040308@huawei.com> (raw)
In-Reply-To: <0d2af0c9-c1a7-ed18-c661-2ad8efcfad26@oracle.com>

Hi Junxiao,

On 2018/11/19 9:35, Junxiao Bi wrote:
> Hi Jun,
> 
> On 11/19/18 8:54 AM, piaojun wrote:
>>> diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
>>> index 7642b6712c39..755ec2aa2db0 100644
>>> --- a/fs/ocfs2/localalloc.c
>>> +++ b/fs/ocfs2/localalloc.c
>>> @@ -345,13 +345,18 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
>>>  	if (num_used
>>>  	    || alloc->id1.bitmap1.i_used
>>>  	    || alloc->id1.bitmap1.i_total
>>> -	    || la->la_bm_off)
>>> -		mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
>>> +	    || la->la_bm_off) {
>>> +		mlog(ML_ERROR, "inconsistent detected, clean journal with"
>>> +		     "unrecovered local alloc, please run fsck.ocfs2!\n"
>>>  		     "found = %u, set = %u, taken = %u, off = %u\n",
>>>  		     num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
>>>  		     le32_to_cpu(alloc->id1.bitmap1.i_total),
>>>  		     OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
>>>  
>> Could we try to recover local alloc with
>> ocfs2_begin_local_alloc_recovery() automatically if it's dirty? And fsck
>> seems a little heavy.
> 
> I supposed the "dirty" here you mean local alloc.
> 
> As i have mentioned in the patch log, recover it during mount is not safe. There could be io error happened after mark journal clean, so corruption may happen to  local alloc and other metadata, run a full fsck is to avoid further corruption.
> 
> Thanks,
> 
> Junxiao.
> 
The "dirty" means local alloc. And I wonder if fsck just does the same
thing with ocfs2_begin_local_alloc_recovery()? I still think recoverying
local alloc won't do harm to it, as that only involves local alloc
metadata. But I'm glad to hear others' opinions about this problem.

Thanks,
Jun

  reply	other threads:[~2018-11-19  1:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16  7:33 [Ocfs2-devel] [PATCH] ocfs2: fix panic due to unrecovered local alloc Junxiao Bi
2018-11-19  0:54 ` piaojun
2018-11-19  1:35   ` Junxiao Bi
2018-11-19  1:52     ` piaojun [this message]
2018-11-19  2:12       ` Junxiao Bi
2018-11-19  2:17 ` jiangyiwen
2018-11-19  3:24   ` Junxiao Bi
2018-11-19  5:54     ` jiangyiwen
2018-11-19  7:15       ` Junxiao Bi
2018-11-19 11:17         ` jiangyiwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BF21740.5040308@huawei.com \
    --to=piaojun@huawei.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.