public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Vazharov <freakpv@gmail.com>
To: Coly Li <i@coly.li>
Cc: mlyle@lyle.org, kent.overstreet@gmail.com,
	linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bcache: io.c: Fix check against error_limit in case of io errors
Date: Sat, 13 Jan 2018 06:22:24 +0200	[thread overview]
Message-ID: <20180113062224.3e72adb5152ac52e0e3f9d2e@gmail.com> (raw)
In-Reply-To: <fe58efbf-a859-e9a3-ba86-ed86232cc51f@coly.li>

On Sat, 13 Jan 2018 11:40:54 +0800
Coly Li <i@coly.li> wrote:

> On 12/01/2018 10:07 PM, Pavel Vazharov wrote:
> > The actual sysfs io_error_limit value is left shifted IO_ERROR_SHIFT
> > times before it is stored in the error_limit.
> > This fixes the un-registering of the cache set when the io_errors reach
> > the error_limit value.
> > 
> > Signed-off-by: Pavel Vazharov <freakpv@gmail.com>
> > ---
> >  drivers/md/bcache/io.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
> > index fac97ec..1ef6ae2 100644
> > --- a/drivers/md/bcache/io.c
> > +++ b/drivers/md/bcache/io.c
> > @@ -93,7 +93,7 @@ void bch_count_io_errors(struct cache *ca, blk_status_t error, const char *m)
> >  						    &ca->io_errors);
> >  		errors >>= IO_ERROR_SHIFT;
> >  
> > -		if (errors < ca->set->error_limit)
> > +		if (errors < (ca->set->error_limit >> IO_ERROR_SHIFT))
> >  			pr_err("%s: IO error on %s, recovering",
> >  			       bdevname(ca->bdev, buf), m);
> >  		else
> > 
> 
> Hi Pavel,
> 
> A similar fix is also in my device failure patch set, its name is,
>     bcache: set error_limit correctly
> The difference is, I remove the bit shift of error_limit.
> 
> -- 
> Coly Li

Hi Coly,

I see your patch. I think it's better solution.
Originally, I was wondering why the shifting of error_limit is needed
when it's set via sysfs just to shift it back here.

-- 
Pavel Vazharov <freakpv@gmail.com>

      reply	other threads:[~2018-01-13  4:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 14:07 [PATCH] bcache: io.c: Fix check against error_limit in case of io errors Pavel Vazharov
2018-01-13  3:40 ` Coly Li
2018-01-13  4:22   ` Pavel Vazharov [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=20180113062224.3e72adb5152ac52e0e3f9d2e@gmail.com \
    --to=freakpv@gmail.com \
    --cc=i@coly.li \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlyle@lyle.org \
    /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