Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1109270imm; Wed, 1 Aug 2018 10:19:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf48n1IAXw04o+M3HtV2e0hl75oXbqgsS1sqVLA78ET830kWC60yWYlWuPLCTJ/qWXFrtp4 X-Received: by 2002:a63:383:: with SMTP id 125-v6mr5903270pgd.421.1533143981913; Wed, 01 Aug 2018 10:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533143981; cv=none; d=google.com; s=arc-20160816; b=QwcUTw3RjNDfVrNLzhmhu8mdDp0bMM5YJAwgu3FgBUrEUNNPqMc+ePDb6EVJiapjlI GCuiFfYWIxNGuJ0sicIiYm1yweJsaHND2kj9eDr6m1ZJrD7ezkZo5sXVdonaifu6eBd0 ja0JGtL7SMNaF7n3rUcik71hCn6NS1ZgqFmin3c4Kr7mY/lN3JsFgEs7X7P7sBYrBXWz n2PNBiDswLlTPgjdVrpRFqXD8kZT0/iNa05osajWBZ+YCswBJ9d8GGZgLaTax1Ys4H0+ SgnqC+vnIyW2N+hbv2huW2MN9Rgy3hCGE0FYhPiF/oa+WeKtoDJdbyLDjvzs6NVrYwul oVuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=xLP7CJYQKYtmoBzSF7eYZhzCjdQFYdk0K0qVJMiJZ6k=; b=xcCp0Nz13lxd+dXrJ113jkVVXS4H0RzAv1xSyT6AYdK6lA30HCT8E1TRRhWXAUFsMn /K3lrW2pHXvYFb5ab9P54ffObvMM4PnrxTBYPMLiSDmVslvDSS2fq4lk1Z/bLBICMH2D 0JOPxn3B9siA3LuQOYCdlAk8CIhOo1mFg/oOwv5IgGpEPckUHVY8t4ai8vhXXvWCI70x aa8EiRKxnNfbyuUr3eDwNLUIh3tek0RpnitTZhYJY5fhGZFkmomv1KdVT5mHreoLNnPj 905uINIQETji/BBMmMua4Etnds+LTIrOOdiOMY+Ntory0b9YDfPd0PBe0O/RxaLdk0Q+ yKng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x25-v6si18054415pfi.138.2018.08.01.10.19.27; Wed, 01 Aug 2018 10:19:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404884AbeHATEt (ORCPT + 99 others); Wed, 1 Aug 2018 15:04:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46756 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404873AbeHATEt (ORCPT ); Wed, 1 Aug 2018 15:04:49 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 172BCCC3; Wed, 1 Aug 2018 17:18:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gioh Kim , Jack Wang , Shaohua Li , Sasha Levin Subject: [PATCH 4.14 127/246] md/raid1: add error handling of read error from FailFast device Date: Wed, 1 Aug 2018 18:50:37 +0200 Message-Id: <20180801165017.808784896@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gioh Kim [ Upstream commit b33d10624fdc15cdf1495f3f00481afccec76783 ] Current handle_read_error() function calls fix_read_error() only if md device is RW and rdev does not include FailFast flag. It does not handle a read error from a RW device including FailFast flag. I am not sure it is intended. But I found that write IO error sets rdev faulty. The md module should handle the read IO error and write IO error equally. So I think read IO error should set rdev faulty. Signed-off-by: Gioh Kim Reviewed-by: Jack Wang Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid1.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2462,6 +2462,8 @@ static void handle_read_error(struct r1c fix_read_error(conf, r1_bio->read_disk, r1_bio->sector, r1_bio->sectors); unfreeze_array(conf); + } else if (mddev->ro == 0 && test_bit(FailFast, &rdev->flags)) { + md_error(mddev, rdev); } else { r1_bio->bios[r1_bio->read_disk] = IO_BLOCKED; }