From: Su Yue <suy.fnst@cn.fujitsu.com>
To: Nikolay Borisov <nborisov@suse.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] btrfs-progs: check: report more specific info about invalid location
Date: Wed, 22 Nov 2017 09:48:03 +0800 [thread overview]
Message-ID: <7bf3e48d-6081-ee10-4e2e-ad79678f94e2@cn.fujitsu.com> (raw)
In-Reply-To: <9fd908df-187d-67a1-266f-e885075d81e8@suse.com>
On 11/21/2017 07:46 PM, Nikolay Borisov wrote:
>
>
> On 21.11.2017 12:15, Su Yue wrote:
>> Previously, it was so useless to print message like
>> "invalid location %d".
>>
>> Let it print objectid and offset of dir_item.
>> Debug is easier now.
>>
>> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
>> ---
>> cmds-check.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cmds-check.c b/cmds-check.c
>> index a93ac2c88a38..5c15dfb60b9a 100644
>> --- a/cmds-check.c
>> +++ b/cmds-check.c
>> @@ -1635,8 +1635,8 @@ static int process_dir_item(struct extent_buffer *eb,
>> namebuf, len, filetype,
>> key->type, error);
>> } else {
>> - fprintf(stderr, "invalid location in dir item %u\n",
>> - location.type);
>> + fprintf(stderr, "invalid location in dir item[%llu %llu]\n",
>> + key->objectid, key->offset);
>
> I think it will be good if in addition to the dir item's key you also
> print the invalid type value. I.e. this check is triggered if
> location.type is unrecognizable. So the error message could be something
> like :
>
> fprintf(stderr, "Unrecognised location.type (%u) in DIR_ITEM[%llu
> %llu]", key->objectid, key->offset);
>
Thanks. Printing location type is more specific.
I will update the patch.
Thanks,
Su
> Let's not force the user to go and read the code to understand why this
> error happened.
>
>
>> add_inode_backref(inode_cache, BTRFS_MULTIPLE_OBJECTIDS,
>> key->objectid, key->offset, namebuf,
>> len, filetype, key->type, error);
>>
>
>
next prev parent reply other threads:[~2017-11-22 1:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 10:15 [PATCH 1/3] btrfs-progs: check: report more specific info about invalid location Su Yue
2017-11-21 10:15 ` [PATCH 2/3] btrfs-progs: check: do not reset ret after try_repair_inode Su Yue
2018-01-08 19:00 ` David Sterba
2017-11-21 10:15 ` [PATCH 3/3] btrfs-progs: check: record last checked root_item in original mode Su Yue
2018-01-08 19:03 ` David Sterba
2018-01-09 7:27 ` Su Yue
2017-11-21 11:46 ` [PATCH 1/3] btrfs-progs: check: report more specific info about invalid location Nikolay Borisov
2017-11-22 1:48 ` Su Yue [this message]
2017-11-22 2:17 ` [PATCH v2 " Su Yue
2017-11-22 7:06 ` Nikolay Borisov
2018-01-08 19:04 ` David Sterba
2018-01-09 7:52 ` [PATCH 2/3 v2] btrfs-progs: check: do not reset ret after try_repair_inode Su Yue
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=7bf3e48d-6081-ee10-4e2e-ad79678f94e2@cn.fujitsu.com \
--to=suy.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@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;
as well as URLs for NNTP newsgroup(s).