Message ID | 20230803132751.2741652-7-yukuai1@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1171512vqx; Thu, 3 Aug 2023 07:06:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPhXmEa5wrvrYpRQZzEvmqAPWVKybzokUNVj06T5nqLUzdw7Sj2AsVVN4UTVnomjDWgilb X-Received: by 2002:aa7:dad3:0:b0:522:ab06:721c with SMTP id x19-20020aa7dad3000000b00522ab06721cmr8025523eds.29.1691071574198; Thu, 03 Aug 2023 07:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691071574; cv=none; d=google.com; s=arc-20160816; b=1AFR8ksCeIJbzILABzcI9q1FKU0Wp5O/0f2kozRySTayKLBJw2zIpd1sqhWgXBnVkQ w5MWH4btSnq/xkWYPf0C7f1suILAem2P98jwY1S1qeYLX2vbHHDw/v8AFHU0msNyddix +XN73npx/a6mfUv0lZRqxM+LGRW63wWityNXlO5TBtD2Oc96NGR8X35ML+Leyg/nn9gS Qky4X5i/k3eC3A3guyJf9vQu82Yu+ihjooULIjWGXu6q811Rr+zDGeG5y4f0FaV90J8X bU3Ny97wAXXVicH6aF1W0hdH110ascQ59wFEVQekw9Bc07KnU1PHHpzeCTscJ83qGYJs mFnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iFtiSvLApmcILfTX7aFOh6lj5nFhyU4kmO4JRc2wrhc=; fh=Ktvf84aTmiKPjIiQsnocICsaz7FvZSNYviQ4CE4oKUo=; b=DdiSbf1HKhTTshxWMfXS4NPi7kPp1IgCKWcnEdeomTyJnTN6tUQEoWRJkL/EhBEf3l jPTQyPnMFm7UB+QsntG6gdwBqPnSu4RYNLyoKKdw1ZdqH8AaYXvjrlFHQP4B2Nl3/zgs 1ifg5bwmWpDDDlGW6KctOTv8+IGqWJB237KzCVIuR0+KXYM0m4H3cGK7gRYAjc2eZnLC R1E9JopMEFH2Or4PiJLraWDeh9CO5v27WN+0yoeCmOEfwBPnOOZnSbOjl5Zv+4As+UpH s5oLDYpn0tIimzbvWNyrVYEcilwvtg06+4rjCRyGKycUYH4qb+cJX9Y7ev2XXTgX66z3 awKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056402068800b00522ca6bf0bdsi6527171edy.186.2023.08.03.07.05.45; Thu, 03 Aug 2023 07:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234622AbjHCNcf (ORCPT <rfc822;jeff.pang.chn@gmail.com> + 99 others); Thu, 3 Aug 2023 09:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235363AbjHCNcC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Aug 2023 09:32:02 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761FA134; Thu, 3 Aug 2023 06:30:56 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RGqVK4SxRz4f41Vj; Thu, 3 Aug 2023 21:30:49 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgCnD7MGrMtkNVvlPQ--.7517S10; Thu, 03 Aug 2023 21:30:50 +0800 (CST) From: Yu Kuai <yukuai1@huaweicloud.com> To: song@kernel.org, xni@redhat.com Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next 6/7] md: don't check 'mddev->pers' from suspend_hi_store() Date: Thu, 3 Aug 2023 21:27:50 +0800 Message-Id: <20230803132751.2741652-7-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230803132751.2741652-1-yukuai1@huaweicloud.com> References: <20230803132751.2741652-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCnD7MGrMtkNVvlPQ--.7517S10 X-Coremail-Antispam: 1UD129KBjvdXoW7XFWUWry8WFWkKr4rZFy3CFg_yoWDGrgE9F sY9FZ3Jr17ZFy7tr1jyws3ZryUKF95W3ZrWF1Skw1YyF45KFy8tr95C3y5Zwn7ZFW8Za4U tryqvr42vr48KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbf8FF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMx C20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAF wI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20x vE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14 v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VU17GYJUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773217067168772555 X-GMAIL-MSGID: 1773217067168772555 |
Series |
md: initialize 'active_io' while allocating
|
|
Commit Message
Yu Kuai
Aug. 3, 2023, 1:27 p.m. UTC
From: Yu Kuai <yukuai3@huawei.com> Now that mddev_suspend() doean't rely on 'mddev->pers' to be set, it's safe to remove such checking. This will also allow the array to be suspended even before the array is ran. Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- drivers/md/md.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c index f14f2f0a9484..a66e00b45be1 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5229,18 +5229,13 @@ suspend_hi_store(struct mddev *mddev, const char *buf, size_t len) err = mddev_lock(mddev); if (err) return err; - err = -EINVAL; - if (mddev->pers == NULL) - goto unlock; mddev_suspend(mddev); mddev->suspend_hi = new; mddev_resume(mddev); - err = 0; -unlock: mddev_unlock(mddev); - return err ?: len; + return len; } static struct md_sysfs_entry md_suspend_hi = __ATTR(suspend_hi, S_IRUGO|S_IWUSR, suspend_hi_show, suspend_hi_store);