From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964841AbeALOH7 (ORCPT + 1 other); Fri, 12 Jan 2018 09:07:59 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40464 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933705AbeALOHh (ORCPT ); Fri, 12 Jan 2018 09:07:37 -0500 X-Google-Smtp-Source: ACJfBot6tJCvE4BqcZJvelgDxw1d9fIpxPCyAE59Q0Ws47/uyy6Wnh+7cFPxOKzd3cmPFGCDbFvang== From: Pavel Vazharov To: mlyle@lyle.org, kent.overstreet@gmail.com Cc: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Vazharov Subject: [PATCH] bcache: io.c: Fix check against error_limit in case of io errors Date: Fri, 12 Jan 2018 16:07:31 +0200 Message-Id: <1515766051-13380-1-git-send-email-freakpv@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- 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 -- 2.7.4