All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>, <linux-btrfs@vger.kernel.org>
Cc: <fdmanana@gmail.com>
Subject: Re: [PATCH] btrfs-progs: Don't increase error count if the inode can be repaired.
Date: Mon, 22 Dec 2014 12:09:25 +0900	[thread overview]
Message-ID: <54978B65.8050807@jp.fujitsu.com> (raw)
In-Reply-To: <1419216816-13171-1-git-send-email-quwenruo@cn.fujitsu.com>

On 2014/12/22 11:53, Qu Wenruo wrote:
> The original check_inode_recs() will return -1 if found any error in a
> inode_record. This is OK for original design since there is almost
> nothing can repair at that time.
> 
> However more and more error from nlink mismatch to missing inode item
> can be repaired in try_repair_inode(), check_inode_recs() should not
> increase the error count if the inode can be repair.
> 
> With this patch, repair function for leaf-corruption will not return
> error if all corruption inode can be recovered.
> 
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>

Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Thanks,
Satoru

> ---
>   cmds-check.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/cmds-check.c b/cmds-check.c
> index 3e7a4eb..aa47984 100644
> --- a/cmds-check.c
> +++ b/cmds-check.c
> @@ -2302,7 +2302,7 @@ static int check_inode_recs(struct btrfs_root *root,
>   	struct inode_record *rec;
>   	struct inode_backref *backref;
>   	int stage = 0;
> -	int ret;
> +	int ret = 0;
>   	int err = 0;
>   	u64 error = 0;
>   	u64 root_dirid = btrfs_root_dirid(&root->root_item);
> @@ -2452,7 +2452,8 @@ static int check_inode_recs(struct btrfs_root *root,
>   			ret = 0;
>   		}
>   
> -		error++;
> +		if (!(repair && ret == 0))
> +			error++;
>   		print_inode_error(root, rec);
>   		list_for_each_entry(backref, &rec->backrefs, list) {
>   			if (!backref->found_dir_item)
> 


      reply	other threads:[~2014-12-22  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22  2:53 [PATCH] btrfs-progs: Don't increase error count if the inode can be repaired Qu Wenruo
2014-12-22  3:09 ` Satoru Takeuchi [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=54978B65.8050807@jp.fujitsu.com \
    --to=takeuchi_satoru@jp.fujitsu.com \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.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.