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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 155B2C678D5 for ; Tue, 7 Mar 2023 17:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbjCGRuT (ORCPT ); Tue, 7 Mar 2023 12:50:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbjCGRt4 (ORCPT ); Tue, 7 Mar 2023 12:49:56 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED75AA2C25 for ; Tue, 7 Mar 2023 09:44:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8646D614DF for ; Tue, 7 Mar 2023 17:44:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67DE3C433EF; Tue, 7 Mar 2023 17:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678211083; bh=F0LrYIngtzAxJQJLg0IX9ZZ7/P4HSgoJskolKaaB5UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MksvjnBd4Qk+/x692iwA6A7ECM18Ts1L3OtlB+RUJfVCLEf6w/mURj88m4RX94/YM hV+HW34xqpCi0qms6UvRW8b2//vYcFRrnFoHRxtMp3teRxBlYS0BtMIXTGPMymGL67 zu+xcaL2H+rTG+091FvxRw17XA5pYJvS6HFSXNF0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Keith Busch , Jens Axboe Subject: [PATCH 6.2 0747/1001] block: clear bio->bi_bdev when putting a bio back in the cache Date: Tue, 7 Mar 2023 17:58:39 +0100 Message-Id: <20230307170054.141856076@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jens Axboe commit 11eb695feb636fa5211067189cad25ac073e7fe5 upstream. This isn't strictly needed in terms of correctness, but it does allow polling to know if the bio has been put already by a different task and hence avoid polling something that we don't need to. Cc: stable@vger.kernel.org Fixes: be4d234d7aeb ("bio: add allocation cache abstraction") Reviewed-by: Keith Busch Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/bio.c | 1 + 1 file changed, 1 insertion(+) --- a/block/bio.c +++ b/block/bio.c @@ -773,6 +773,7 @@ static inline void bio_put_percpu_cache( if ((bio->bi_opf & REQ_POLLED) && !WARN_ON_ONCE(in_interrupt())) { bio->bi_next = cache->free_list; + bio->bi_bdev = NULL; cache->free_list = bio; cache->nr++; } else {