Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2297468pxu; Fri, 9 Oct 2020 13:00:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXSVZK/IGFsKVXC+/r//nREY1pAdfSDe5PsmgnuJabq/uiED230QjoLhEQcSNrHEnEOUV5 X-Received: by 2002:a50:f613:: with SMTP id c19mr925316edn.81.1602273620199; Fri, 09 Oct 2020 13:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602273620; cv=none; d=google.com; s=arc-20160816; b=QhxcnA4NYbPUdHeG+GI9y8luaKRg0NX+Es65oTTZM72/Z7YfjJwoyc9yhsdVdJbfih Id8hDefiUYVhOrO7ZlpBWHALj6R8YKtXnivWIfxh08tXBfKfYzoRw0pOArpufRBtep2g u04kcZDSekpiRtxWAdyH3WrOI3fxfhTgJDxRI7aVSaXqx9XP0OniorlEc6W9Pr91CTwn 8UMLooU1NqlJMoHq86x4AqO9aTGvX+VYKDVq/+3LEG8ZDeXdJy/6b7F16xAVMl6GVi6V LmFZIsTBMPoZi6hAIADUHgVlF2izfQycWfJX4bObxJ2pYWwS8m5X8ZdTTQMm3gIQ2ZIM 1Tww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=DvcPVK52TeNGe98XcbxvkqT3utUuhvx8w1/It1iKwEY=; b=CvlEaNnp3bzkxp7qgppeIrrVKXQUhg7mMrwFpLW0WCU+5wCdUnZtWd70mOj4sCMy3u 5XlaXJ2Kn8tMP2XgRYXgEGdG6gMfZpjOSnO3GgUdSerFJEb8GZHSlKbClI/fVK0rL9HZ pviSRrEgbEXfzwttNZ6IayN/O9adUuleEKPYNf7YIKgI2D+yMQ5cILtXEW/T4fqnAK4v mSuFmMeqZwa4V+vQujrcMC54IHv2eEcuECUKOtv/DPhV6jsBFJInfpMZQLClBB5yolBm /7m+A6LkJaMbTqsGkC3aWCyEZrXk6gbJErZmZJsqm4x17pr5tg39JGK2j9cc/as6TQlF EPrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=2B2Icuvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y101si6602261ede.543.2020.10.09.12.59.56; Fri, 09 Oct 2020 13:00:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=2B2Icuvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387642AbgJISqr (ORCPT + 99 others); Fri, 9 Oct 2020 14:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387507AbgJISqr (ORCPT ); Fri, 9 Oct 2020 14:46:47 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8A19C0613D5 for ; Fri, 9 Oct 2020 11:46:46 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id y14so7587471pfp.13 for ; Fri, 09 Oct 2020 11:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DvcPVK52TeNGe98XcbxvkqT3utUuhvx8w1/It1iKwEY=; b=2B2IcuvnFVgxHqo1kutPy1Gw0AqK79pzvXF6mUZX3GfTzQ/i31LqvwPiAIknrVTBSC a6gbVSFp34Ic3S4oG5bbubPTfvqv2NfdryMsXx6uoMHudUtqpjpJqmXkYn75oAL24SWC 5a6D1kD0A2SX6mZRVoE5ClYo6KpbFXLW78FnPwL8URFtR8FgAY9ha3/sbvftE7y/wAOa DsuZlEVfEKvuoModoTWjcIemDCp1nKuF2OBXhU4wh21y6+/mtU8u4euj0B+4HYTtLS1f FJnblch/iSmgukYy3cPTn15LzV433HDSi2OOlIGcgco5/SjcGuwvsUufGOaRWYJzGaHc hP0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DvcPVK52TeNGe98XcbxvkqT3utUuhvx8w1/It1iKwEY=; b=YUgSMVnpVlTnQ25BPomf44ChQpC4ysiBhcm/gkfC3x9si8x+ZNXI1fSSMu+QD+TpOJ jssRvcBcGWShfAu+DTpjuNU/M0g/vqJY62ZW7Y3b/Luf71rkBxUSQ01MnP7z4Ei5ROJM OPWd2pYmHaSXExpLVzegyZpCVwdd9LjQLbGnDJsyRQMZ4DeSdv07gfbNVi96h4wE/lD9 OLPfu63SpcCJLrkv1t0cHvWoLpUvIgE+l0ONshzzlh4GNJmOxkytvrLIu7kAwc1NA5Uf Q4+dHCkEbkK+Au2rma3Qy8hWn4xx651aBgi5LknjwOv3+X/S+2Z28mFsxHgGUUmTa1Pu vvDg== X-Gm-Message-State: AOAM532OLh2ZT97Ic11AF+CYcSBcC7iU3ZLbmMKMpATsh2QEr0vosB+l 1dKazb3ChF2kau30LK6JVHCqVg== X-Received: by 2002:a62:7f08:0:b029:155:79a4:1364 with SMTP id a8-20020a627f080000b029015579a41364mr6748421pfd.38.1602269206388; Fri, 09 Oct 2020 11:46:46 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id p6sm12674785pjd.1.2020.10.09.11.46.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 11:46:45 -0700 (PDT) Subject: Re: [PATCH] blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue To: Yang Yang , Bart Van Assche , Hannes Reinecke , Ming Lei , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: onlyfever@icloud.com References: <20201009080015.3217-1-yang.yang@vivo.com> From: Jens Axboe Message-ID: Date: Fri, 9 Oct 2020 12:46:43 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201009080015.3217-1-yang.yang@vivo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/9/20 2:00 AM, Yang Yang wrote: > blk_exit_queue will free elevator_data, while blk_mq_run_work_fn > will access it. Move cancel of hctx->run_work to the front of > blk_exit_queue to avoid use-after-free. Applied, thanks. -- Jens Axboe