Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31673613rwd; Fri, 7 Jul 2023 02:49:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEV5lFhgk+Ap3XhbHTfLTWtV1r9BQUH9UK3YAmoiLiBOao7PYDN4WHmZesHoHpnISRCAPuk X-Received: by 2002:a05:6808:6387:b0:3a3:7a73:f1a8 with SMTP id ec7-20020a056808638700b003a37a73f1a8mr3980882oib.41.1688723346200; Fri, 07 Jul 2023 02:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688723346; cv=none; d=google.com; s=arc-20160816; b=q5C4hJZbDg8rKFjwpboyWb4b3FcMPk2JkEWGhRsLpNa4IezvvnFYElTz7wLlvze6Dr stHcckI2cRzwLwS3qC02i64CBY+UmGQ35DMK5bagNw6VaZK/X2gTL0ZSCAfRn2L5UXAH H7Csueae8/srJbzFSxblo96aXfIzUhoiSsv4N5RNHd8eOlppLsm+hA9WYghI5k3glQQ7 1VtXGRH3lfsh3ApDPqoNh5o9ncD3RD1Ca5M1cNhZVr0l4wHYqsqxIKgXKXX7Yp/SNBxr Gs0ErxJVnbrsuF2Mlwu5ZUw18QtkRy3UHiMYQJu8SmnRTxh7WFtjFNDnc8QiceDIe2Gi XGVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ElpIwjpZa9Cy906H5ZxmudthuG5AQ3NqRQ9U5q9ON2I=; fh=syhxPkKddSLKiB0phHJpSfXrEbbqcI22wXgkjEKh4f0=; b=DA6h173zNL4Da358XG7Zj+STQbUDF9Mh2Q++6xB+nPI7s34HolIXsOD9Pk2CvG1bHO aPFcYI9kWDmDotbK3lu4YHE7YL77AU9bSv4OkBbEpsK86q21k9EmPiSP852qXYcCzHp+ UaufUJzapB3la5RVoNcXr9QcVNq0RIabQaO8EaQa26cr0B3scjimmDp60/CMr1uyMHp0 KoOM2jFP0B1gwfgkoPk+an2mOzg2RUPM/E58/NImi/sbsMjH0Kn4mNnAz1zkDtBrXwqZ hjbqah/UxotMz4qI9ln3IaUmOQ8be7GNWMPEywqSRCF2QFUUUpqXbV2hfsGzsVONpPmN UTRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xy+XR4N+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf22-20020a17090b0b1600b0025bec4468c2si1685354pjb.167.2023.07.07.02.48.54; Fri, 07 Jul 2023 02:49:06 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xy+XR4N+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232576AbjGGJG6 (ORCPT + 99 others); Fri, 7 Jul 2023 05:06:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjGGJG4 (ORCPT ); Fri, 7 Jul 2023 05:06:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E311FED; Fri, 7 Jul 2023 02:06:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 98385618A6; Fri, 7 Jul 2023 09:06:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 090BBC433C9; Fri, 7 Jul 2023 09:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688720814; bh=ElpIwjpZa9Cy906H5ZxmudthuG5AQ3NqRQ9U5q9ON2I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Xy+XR4N+a7rEHW7AJ+5oa/3qTjrRvL8u/YhGCrn6nocuvUYThjZM6l8E8+F9DiydW 4rLoFpR/jnTRgHLp2Aq7gzzz1bt/oAJXJFXbvLGEOMjoJ61ByRF3oCOIAR0hoFgr57 RTJfYinxPlbmNy2+w1GDTfEywgv65ZHSfJee/sRd+axUKgRrw42tgulj848GVe24uM gsE2CFA6bWAbmBUlAEnlxt7jtJ3OjcQ0bw24MjTBeUJXS4sYhxpq9D89JM+uEn4OIb IWUBwplPJiRCjdQntxu2u+UJb5rIMK2BtRC7YNJFuMqzPxdCyM1zqnSIWU1Rn/ah6U wa3IFynN1D9vg== Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2b6b98ac328so24263081fa.0; Fri, 07 Jul 2023 02:06:53 -0700 (PDT) X-Gm-Message-State: ABy/qLZEBSqVwfejEo2EdOAMg7QbI62sfNKhr1I2Oh1aUW133ZY843d7 RCk9kdPHAhz6QkHixRKiDHdBwIfAPuOfXpWYQII= X-Received: by 2002:a2e:3317:0:b0:2b6:cb55:72bc with SMTP id d23-20020a2e3317000000b002b6cb5572bcmr3500359ljc.1.1688720812072; Fri, 07 Jul 2023 02:06:52 -0700 (PDT) MIME-Version: 1.0 References: <20230628012931.88911-1-yukuai1@huaweicloud.com> <20230628012931.88911-2-yukuai1@huaweicloud.com> <10137916-9feb-8ab6-e157-8c66bbad1932@huaweicloud.com> In-Reply-To: <10137916-9feb-8ab6-e157-8c66bbad1932@huaweicloud.com> From: Song Liu Date: Fri, 7 Jul 2023 17:06:39 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next 1/2] md: don't quiesce in mddev_suspend() To: Yu Kuai Cc: xni@redhat.com, colyli@suse.de, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 2:29=E2=80=AFPM Yu Kuai w= rote: > > Hi, > > =E5=9C=A8 2023/06/28 9:29, Yu Kuai =E5=86=99=E9=81=93: > > From: Yu Kuai > > > > Some levels doesn't implement "pers->quiesce", for example > > raid0_quiesce() is empty, and now that all levels will drop 'active_io' > > until io is done, wait for 'active_io' to be 0 is enough to make sure a= ll > > normal io is done, and percpu_ref_kill() for 'active_io' will make sure > > no new normal io can be dispatched. There is no need to call > > "pers->quiesce" anymore from mddev_suspend(). > > Just found that this patch actually prevent null_ptr_deref in some cases > that "pers->quiesce" is NULl for some personalities, and caller of > mddev_suspend() doesn't check this. For example, suspend_lo_store() > checks "pers->quiesce" is not NULL before calling mddev_suspend(), while > suspend_hi_store() doesn't. Let's refactor the code so that suspend_lo_store() and suspend_hi_store() share code for this logic. Thanks, Song