Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32697164rwd; Fri, 7 Jul 2023 19:49:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5ZlyhD+NHN7NM+HUaKUOv0cRgGbK4WwFKoqdhixSf1DSqJ7fllYiyXapovAH0uzEE/ljL X-Received: by 2002:a05:6a20:54a6:b0:12d:346f:d8ac with SMTP id i38-20020a056a2054a600b0012d346fd8acmr7586004pzk.44.1688784591240; Fri, 07 Jul 2023 19:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688784591; cv=none; d=google.com; s=arc-20160816; b=MnIZeZCNJbgHM4+mK4cWETQyMxk7TFuyc4OWuff0rI8ryNOGVoYJaHX6yUDbeJstNm Qbljtf+crCYlHJ6dNIHp0Nf3J8yxCjzyd7ihcA+xH9HewqbZZk4hB3p5T/GJdyexamJT J95BydH6bp2Dh5GLWlp3/i5uyBEzeTIm2mcitz3V3Ki3Jzq2E7PEIRbEiHMg3pg+MSAO ROPtResCrI+MnENU5CBmZbjpo5gGPAjB+9b6TGzYeChfEtlEWcXyqG2tTzp5CrfEUffn MVBhKxx1AcXo0mKhAlCwR9zj+pBnXZ/DRJ5mgHJgrbmpIEkil15Fi1antGGFxJw/PUaH kCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=dwaFQHMIH9SR8HWdfSrp1Jk/1f2vRDuyCIdo6oF7E3w=; fh=T0G9u7d/yiXTEcpDN6SngAiidtifgySAtadiIDfw8No=; b=RpD9Bo3f/UNF9n7z0sMVenZWR1s5dpT8/ifnvFNN//GU9P6BsTXNTCZPC4LmGR59Yq 4QExCHKWf7ppJryi98DDpVb0S0+Rb2fp58yDNS/03tgHOC3SjXBMlwYmuMva2WyYLTt7 mgOCrbDy0zoztdyryCR9akHrlC+lqzavyjIwY0M40Mz2iqZLv/nflwYhWzj9PV2jN3UQ pdLOgRoRLezAWNWlrrWMxcdGR+KojwscdnVRngeS75vTHot4r4QZqJy8SIpoSg90QeRD gDHSGQshFqgqhvN64rzjwQ0yXJD54TVM+43rBUzD7AMQg/Pldd1UqaNklZ5TyuboeMxS u12Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b005538026cc36si5076344pgw.152.2023.07.07.19.49.39; Fri, 07 Jul 2023 19:49:51 -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 S232301AbjGHCmG (ORCPT + 99 others); Fri, 7 Jul 2023 22:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjGHCmE (ORCPT ); Fri, 7 Jul 2023 22:42:04 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D057DBA; Fri, 7 Jul 2023 19:42:00 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QyZKb6s3Hz4f3lCr; Sat, 8 Jul 2023 10:41:55 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP4 (Coremail) with SMTP id gCh0CgCHLaHyzKhkbSHbNQ--.51207S3; Sat, 08 Jul 2023 10:41:56 +0800 (CST) Subject: Re: [PATCH -next v2 2/2] md/raid5-cache: fix null-ptr-deref in r5l_reclaim_thread() To: Song Liu , Yu Kuai Cc: xni@redhat.com, logang@deltatee.com, hch@lst.de, shli@fb.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawwe.com, "yukuai (C)" References: <20230628010756.70649-1-yukuai1@huaweicloud.com> <20230628010756.70649-3-yukuai1@huaweicloud.com> <4690dfff-ad72-bf83-7feb-75018712eb17@huaweicloud.com> From: Yu Kuai Message-ID: Date: Sat, 8 Jul 2023 10:41:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCHLaHyzKhkbSHbNQ--.51207S3 X-Coremail-Antispam: 1UD129KBjvdXoWrKw1kXw18JFykWry3Xw1kKrg_yoW3WFg_ur WYvr1DKw47uF1akan7CF1Skwn7GFW5Ja4rXrW8JF4kKrWrZrW0gF4kZ393W3y3Cw4kG3Z3 WrWrX3ySq3yDGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3AFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kI c2xKxwCYjI0SjxkI62AI1cAE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq 3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCT nIWIevJa73UjIFyTuYvjfUoOJ5UUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 在 2023/07/07 17:36, Song Liu 写道: > On Fri, Jul 7, 2023 at 5:19 PM Yu Kuai wrote: >> >> Hi, >> >> 在 2023/07/07 17:16, Yu Kuai 写道: >>> Perhaps you means this order? >>> >>> r5l_exit_log >>> flush_work(&log->disable_writeback_work) >>> conf->log = NULL >>> md_unregister_thread(&log->reclaim_thread) >>> >>> I think this is better indeed. >> Never mind, this is wrong, I got confused... >> >> Please ignore this and take a look at my original fix. > > How about > > r5l_exit_log > md_unregister_thread(&log->reclaim_thread) > conf->log = NULL > flush_work(&log->disable_writeback_work) > > ? This looks correct, expect that wake_up() should be moved together. I'll send a v2. Thanks, Kuai > > Thanks, > Song > . >