Linux block layer
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: Add error string for EUCLEAN
Date: Sat, 6 Apr 2019 09:20:35 +0300	[thread overview]
Message-ID: <782bc384-9022-6f5d-d4d5-90ff180bbb90@suse.com> (raw)
In-Reply-To: <02797135-0903-4d4d-67a1-469a13e20397@gmx.com>



On 6.04.19 г. 8:05 ч., Qu Wenruo wrote:
> 
> 
> On 2019/4/6 下午12:50, Darrick J. Wong wrote:
>> On Sat, Apr 06, 2019 at 11:14:26AM +0800, Qu Wenruo wrote:
>>> Since we're going to support write time tree checker, it's possible that
>>> transaction get aborted due to tree-checker, also due to new
>>> BLK_STS_SELFTEST bit, we can distinguish real EIO error and EUCLEAN
>>> error.
>>>
>>> Now add error string for EUCLEAN too.
>>>
>>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>>> ---
>>>  fs/btrfs/super.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
>>> index 120e4340792a..a4cbbd7861d3 100644
>>> --- a/fs/btrfs/super.c
>>> +++ b/fs/btrfs/super.c
>>> @@ -86,6 +86,9 @@ const char *btrfs_decode_error(int errno)
>>>  	case -ENOENT:
>>>  		errstr = "No such entry";
>>>  		break;
>>> +	case -EUCLEAN:
>>> +		errstr = "Selftest failure";
>>> +		break;
>>
>> EUCLEAN usually spits out "Structure needs cleaning" in userspace (and
>> ext4 & xfs have been using it for years to complain about corrupt data),
>> so why diverge here?
> 
> Because the original "structure needs cleaning" doesn't really show the
> meaning we're using.

On the contrary, structure needs cleaning means the filesystem has
detected a consistency error. How that detection has happened shouldn't
burden the user, the important fact is it has. Selftest is somewhat
cryptic, I'd suggest at least "verification error" or just go with
canonical "Structure needs cleaning".

> 
> We really means, something wrong happened, thus I prefer something like
> selftest failure.
> 
> And, the idea of adding -EUCLEAN, is to replace the original "unknown"
> output, if you're sticking with the original error string, we still need
> that branch.
> 
>>
>> Wait... does "tree-checker" mean online metadata checking, and 'selftest
>> failure' is what gets spit out when it finds some metadata it doesn't
>> like?
> 
> Yep.
> 
> Thanks,
> Qu
> 
>>
>> --D
>>
>>>  	}
>>>  
>>>  	return errstr;
>>> -- 
>>> 2.21.0
>>>
> 

  reply	other threads:[~2019-04-06  6:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-06  3:14 [PATCH 1/2] block: Add new BLK_STS_SELFTEST status Qu Wenruo
2019-04-06  3:14 ` [PATCH 2/2] btrfs: Add error string for EUCLEAN Qu Wenruo
2019-04-06  4:50   ` Darrick J. Wong
2019-04-06  5:05     ` Qu Wenruo
2019-04-06  6:20       ` Nikolay Borisov [this message]
2019-04-06  7:56         ` Qu Wenruo
2019-04-06  8:41 ` [PATCH 1/2] block: Add new BLK_STS_SELFTEST status Nikolay Borisov
2019-04-06  9:18   ` Qu Wenruo
2019-04-06  9:31     ` Nikolay Borisov

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=782bc384-9022-6f5d-d4d5-90ff180bbb90@suse.com \
    --to=nborisov@suse.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox