From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] block: Add new BLK_STS_SELFTEST status
Date: Sat, 6 Apr 2019 12:31:20 +0300 [thread overview]
Message-ID: <184fe5a1-7007-e8d9-7605-7394e7865f31@suse.com> (raw)
In-Reply-To: <d959f6d7-ee8b-1441-1484-7d6ba276c122@gmx.com>
On 6.04.19 г. 12:18 ч., Qu Wenruo wrote:
>
>
> On 2019/4/6 下午4:41, Nikolay Borisov wrote:
>>
>>
>> On 6.04.19 г. 6:14 ч., Qu Wenruo wrote:
>>> There are a lot of end_io hooks which can do some self test at
>>> read/write time.
>>>
>>> Normally such selftest should return -EUCLEAN to indicate something
>>> unexpected.
>>>
>>> However there is no BLK_STS_* bit for that, this makes every selftest
>>> error to be interpreted to EIO, which lowers the severity.
>>>
>>> This patch will add a new BLK_STS_SELFTEST, to allow the error from
>>> endio to be passed to filesystem.
>>>
>>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>>> ---
>>> block/blk-core.c | 1 +
>>> include/linux/blk_types.h | 3 +++
>>> 2 files changed, 4 insertions(+)
>>>
>>> diff --git a/block/blk-core.c b/block/blk-core.c
>>> index 4673ebe42255..66967642a5ef 100644
>>> --- a/block/blk-core.c
>>> +++ b/block/blk-core.c
>>> @@ -135,6 +135,7 @@ static const struct {
>>> [BLK_STS_RESOURCE] = { -ENOMEM, "kernel resource" },
>>> [BLK_STS_DEV_RESOURCE] = { -EBUSY, "device resource" },
>>> [BLK_STS_AGAIN] = { -EAGAIN, "nonblocking retry" },
>>> + [BLK_STS_SELFTEST] = { -EUCLEAN, "filesystem selftest" },
>>
>> SELFTEST is ambiguous, I personally relate it to the selftests that some
>> subsystems have. This should be changed to STS_CLEANUP or STS_CORRUPT or
>> some such.
>
> Considering my poor naming schemes, what about sticking to EUCLEAN
> across all of these?
> BLK_STS_UCLEAN -ECULEAN "Structure needs clean up"
Sounds good!
>
> Thanks,
> Qu
>
>>
>>>
>>> /* device mapper special case, should not leak out: */
>>> [BLK_STS_DM_REQUEUE] = { -EREMCHG, "dm internal retry" },
>>> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
>>> index 791fee35df88..5bba24c3753c 100644
>>> --- a/include/linux/blk_types.h
>>> +++ b/include/linux/blk_types.h
>>> @@ -63,6 +63,9 @@ typedef u8 __bitwise blk_status_t;
>>> */
>>> #define BLK_STS_DEV_RESOURCE ((__force blk_status_t)13)
>>>
>>> +/* Filesystem selftest error */
>>> +#define BLK_STS_SELFTEST ((__force blk_status_t)14)
>>> +
>>> /**
>>> * blk_path_error - returns true if error may be path related
>>> * @error: status the request was completed with
>>>
>
prev parent reply other threads:[~2019-04-06 9:31 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
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 [this message]
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=184fe5a1-7007-e8d9-7605-7394e7865f31@suse.com \
--to=nborisov@suse.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