Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3927163imm; Mon, 8 Oct 2018 11:49:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Sa6VH57xCSq8TruPSs5ZSK+r1f5SMUv6fyz115NDJKcFfE/3WJ0gIuf1RFg5fTGWRwDfS X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr25396338pll.65.1539024559609; Mon, 08 Oct 2018 11:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024559; cv=none; d=google.com; s=arc-20160816; b=pw1KkMEp5MU+GEUDf5BODeyVneDM1PpQ4nqbZVu3CGnbynI/gYXCHyGdfp+WpZR2YS cZ1bM4OAYJH3fcNWAcIl1nJaGn32EqTHFBPc4sDtUtgUGO+duV1u1a6tdgCEuRR/Cg/m Zv2sSdQ/zgo/Jft88Tkxp5ceuUr2ZWHjgqaD0yM7HJTo18Wmw0OcuXSjN6eJT6IGnvPs QAqjOh7ahNVi5STJjzU4BYiT3/AOhHqOhnO4AwoPJH9hoTnjOhStR3qi4H8ZWJ6XvHET quXqkkGK07t68bQbbvGhHbFXsnTf3/eRsdT/e9UOH+d+cUlX4QvEnk5yrgE9vwlIgyyq BCgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BEwlmxS+8uQPAWTGSBYHnKACNS2WeqpqGIkEn5NToVs=; b=0odTy1U3SKhqrCgZjkWvK5GPGrWCrwRGPra+WaOOxWwkfxhZDhojCtgsmZzVtW82NO 2sPCYoTvaf3C+NUe6ykoJgzwGCNQGHIiHvzNfy62aRn3BvBtt1HKkL5qexudNuuEREO7 a0abQVNgXfCwUF473uT/lnIxKgb5s0J7llEQ0M7F6YyN2wGzf+h/CY1gR+1h9VaeH7P3 nFtTOvHa6JtxO63fS0EIKw6qNSKf+iWLMfVT/ZKbuY5cPCOZlncTdWOXmwgL7ULVcPUA QYQRGsIU8MYSVhXDfFASX+WFXPTCB1EwV7xyk1K8icNKhXuB9om/jhh+yesIhPSk7XnK ATMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EWOFe2D7; 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 e3-v6si19178520plk.114.2018.10.08.11.49.04; Mon, 08 Oct 2018 11:49:19 -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; dkim=pass header.i=@kernel.org header.s=default header.b=EWOFe2D7; 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 S1731474AbeJICAo (ORCPT + 99 others); Mon, 8 Oct 2018 22:00:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:49486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730798AbeJICAn (ORCPT ); Mon, 8 Oct 2018 22:00:43 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B326204FD; Mon, 8 Oct 2018 18:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024456; bh=NEHEC+kMKHYYFu+Gz40bNY3oj8b9NZF2V20XFJmMt+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EWOFe2D7ZxdsSD6qm6nYS0YWSpl1+wnnHrX3W60zaJIkR89kZm2uYRbCldzv17CF+ xwL1P/ki6cjCWlF2yOEEYkwdPijjmNZFDUdsvtrGl8YKEOrqtl3vOW4Qut+udgV6M4 smRj50kOEdueAxmV99YlntoHtqT4MMLfaxYXskXI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Ni , Shaohua Li , Sasha Levin Subject: [PATCH 4.18 046/168] md/raid5-cache: disable reshape completely Date: Mon, 8 Oct 2018 20:30:26 +0200 Message-Id: <20181008175621.806900860@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shaohua Li [ Upstream commit e254de6bcf3f5b6e78a92ac95fb91acef8adfe1a ] We don't support reshape yet if an array supports log device. Previously we determine the fact by checking ->log. However, ->log could be NULL after a log device is removed, but the array is still marked to support log device. Don't allow reshape in this case too. User can disable log device support by setting 'consistency_policy' to 'resync' then do reshape. Reported-by: Xiao Ni Tested-by: Xiao Ni Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid5-log.h | 5 +++++ drivers/md/raid5.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) --- a/drivers/md/raid5-log.h +++ b/drivers/md/raid5-log.h @@ -46,6 +46,11 @@ extern int ppl_modify_log(struct r5conf extern void ppl_quiesce(struct r5conf *conf, int quiesce); extern int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio); +static inline bool raid5_has_log(struct r5conf *conf) +{ + return test_bit(MD_HAS_JOURNAL, &conf->mddev->flags); +} + static inline bool raid5_has_ppl(struct r5conf *conf) { return test_bit(MD_HAS_PPL, &conf->mddev->flags); --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -735,7 +735,7 @@ static bool stripe_can_batch(struct stri { struct r5conf *conf = sh->raid_conf; - if (conf->log || raid5_has_ppl(conf)) + if (raid5_has_log(conf) || raid5_has_ppl(conf)) return false; return test_bit(STRIPE_BATCH_READY, &sh->state) && !test_bit(STRIPE_BITMAP_PENDING, &sh->state) && @@ -7739,7 +7739,7 @@ static int raid5_resize(struct mddev *md sector_t newsize; struct r5conf *conf = mddev->private; - if (conf->log || raid5_has_ppl(conf)) + if (raid5_has_log(conf) || raid5_has_ppl(conf)) return -EINVAL; sectors &= ~((sector_t)conf->chunk_sectors - 1); newsize = raid5_size(mddev, sectors, mddev->raid_disks); @@ -7790,7 +7790,7 @@ static int check_reshape(struct mddev *m { struct r5conf *conf = mddev->private; - if (conf->log || raid5_has_ppl(conf)) + if (raid5_has_log(conf) || raid5_has_ppl(conf)) return -EINVAL; if (mddev->delta_disks == 0 && mddev->new_layout == mddev->layout &&