From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F324BC4320E for ; Wed, 11 Aug 2021 02:28:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7934260EC0 for ; Wed, 11 Aug 2021 02:28:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7934260EC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E9B2E8D0001; Tue, 10 Aug 2021 22:28:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E24D36B0072; Tue, 10 Aug 2021 22:28:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEC4B8D0001; Tue, 10 Aug 2021 22:28:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id B0EB66B0071 for ; Tue, 10 Aug 2021 22:28:17 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 553B3181B0487 for ; Wed, 11 Aug 2021 02:28:17 +0000 (UTC) X-FDA: 78461215434.38.7A2C96B Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by imf18.hostedemail.com (Postfix) with ESMTP id A7525400B594 for ; Wed, 11 Aug 2021 02:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1628648896; x=1660184896; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=mqrHT7lSpTYubUb4Uun7g5pFgQ69qr5SKKRD11vsmq0=; b=JvNZhWNvumb8G88QE10wPP8YcMYCmx9oBZj++uiZHW7pwTlhgXb+40Ib wimg5rE3J07ekgbDzFCz+TDBXX+YcDs8VPtVgiEUC6MTtzHdcB8vrXRm/ 0XXT/salT0njayr4StAj80AaO8SkfsR0F7daRQrhE3R7tL6+JqY73x2AB 0=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 10 Aug 2021 19:28:15 -0700 X-QCInternal: smtphost Received: from nasanexm03e.na.qualcomm.com ([10.85.0.48]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/AES256-SHA; 10 Aug 2021 19:28:15 -0700 Received: from [10.111.168.10] (10.80.80.8) by nasanexm03e.na.qualcomm.com (10.85.0.48) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 10 Aug 2021 19:28:13 -0700 Subject: Re: move the bdi from the request_queue to the gendisk To: Christoph Hellwig CC: Jens Axboe , Tejun Heo , Jan Kara , , Andrew Morton , , , References: <20210809141744.1203023-1-hch@lst.de> <20210810200256.GA30809@lst.de> From: Qian Cai Message-ID: <4e108ea6-b1dd-510e-afc4-757eae697dab@quicinc.com> Date: Tue, 10 Aug 2021 22:28:12 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210810200256.GA30809@lst.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm03c.na.qualcomm.com (10.85.0.106) To nasanexm03e.na.qualcomm.com (10.85.0.48) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A7525400B594 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=JvNZhWNv; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf18.hostedemail.com: domain of quic_qiancai@quicinc.com designates 199.106.114.39 as permitted sender) smtp.mailfrom=quic_qiancai@quicinc.com X-Stat-Signature: 5ck1injkiiezecg8espergdp66jg8sq1 X-HE-Tag: 1628648896-12933 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 8/10/2021 4:02 PM, Christoph Hellwig wrote: > On Tue, Aug 10, 2021 at 03:36:39PM -0400, Qian Cai wrote: >> >> >> On 8/9/2021 10:17 AM, Christoph Hellwig wrote: >>> Hi Jens, >>> >>> this series moves the pointer to the bdi from the request_queue >>> to the bdi, better matching the life time rules of the different >>> objects. >> >> Reverting this series fixed an use-after-free in bdev_evict_inode(). > > Please try the patch below as a band-aid. Although the proper fix is > that non-default bdi_writeback structures grab a reference to the bdi, > as this was a landmine that might have already caused spurious issues > before. This works fine with a quick test.