From patchwork Wed Apr 8 12:27:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinz Mauelshagen X-Patchwork-Id: 6179151 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E93BBF4A6 for ; Wed, 8 Apr 2015 12:31:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CBB720377 for ; Wed, 8 Apr 2015 12:31:46 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B466B2037C for ; Wed, 8 Apr 2015 12:31:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t38CRbqh026157; Wed, 8 Apr 2015 08:27:38 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t38CRaLJ017769 for ; Wed, 8 Apr 2015 08:27:36 -0400 Received: from o.ww.redhat.com (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t38CRYrT010820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Apr 2015 08:27:35 -0400 Received: from o.ww.redhat.com (localhost.localdomain [127.0.0.1]) by o.ww.redhat.com (8.14.9/8.14.9) with ESMTP id t38CRYm3005883; Wed, 8 Apr 2015 14:27:34 +0200 Received: (from mauelsha@localhost) by o.ww.redhat.com (8.14.9/8.14.9/Submit) id t38CRYLj005882; Wed, 8 Apr 2015 14:27:34 +0200 From: heinzm@redhat.com To: dm-devel@redhat.com Date: Wed, 8 Apr 2015 14:27:34 +0200 Message-Id: <1428496054-5837-3-git-send-email-heinzm@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: dm-devel@redhat.com Cc: Heinz Mauelshagen Subject: [dm-devel] [PATCH 2/2] dm-raid1: [PATCH RFC] dm-raid1: keep writing after leg failure -> fix error end io logic if 'keep_log' set for on log failure; add ctr/... comments X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Heinz Mauelshagen The error endio log path seems wrong, because the patch fails the io in case "keep_log" is set and the log is _not_ errored. It should be failed (as the comment explains), when "keep_log" is set and the log has failed. Signed-off-by: Heinz Mauelshagen --- drivers/md/dm-raid1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index ef5f20c..cbf3527 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -813,9 +813,11 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures) */ /* - * we return EIO when the log device is failed if keep_log is set + * We return EIO when there's no valid mirror legs + * -or- + * the log device is failed if keep_log is set */ - if (!get_valid_mirror(ms) || (keep_log(ms) && !ms->log_failure)) + if (unlikely(!get_valid_mirror(ms) || (keep_log(ms) && ms->log_failure))) bio_endio(bio, -EIO); /* * After the userspace get noticed that the leg has failed, @@ -1048,7 +1050,7 @@ static int parse_features(struct mirror_set *ms, unsigned argc, char **argv, * log_type is "core" or "disk" * #log_params is between 1 and 3 * - * If present, features must be "handle_errors". + * If present, features must be "handle_errors" and/or "keep_log". */ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) { @@ -1417,7 +1419,6 @@ static void mirror_status(struct dm_target *ti, status_type_t type, DMEMIT(" 2 handle_errors keep_log"); else if (errors_handled(ms)) DMEMIT(" 1 handle_errors"); - } }