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 71F3EC433EF for ; Wed, 8 Jun 2022 12:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238564AbiFHMG4 (ORCPT ); Wed, 8 Jun 2022 08:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiFHMGz (ORCPT ); Wed, 8 Jun 2022 08:06:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C329B2408A; Wed, 8 Jun 2022 05:06:54 -0700 (PDT) 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 5B3D26187F; Wed, 8 Jun 2022 12:06:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67F6FC3411C; Wed, 8 Jun 2022 12:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654690013; bh=3OGpcCZEusqeV7WTYQWC5s+kZ9Fakcr/VjfHB1Q0iqg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Nv60BFxCLTZpsg9a095nuV92mujJrLLFgD/N4VzGvLYLu/LpYsM5DK/YQfi6wJIrD HklSFIksJNxMskO+6rbmtz+Q9Cz3CeVH0ZwuBc5InXaZ+6yU0pAZn+i4vPiI2bzi86 OscKygEfWcljX1VbdFugnfQ09o+/fZf7omHwjf3c= Date: Wed, 8 Jun 2022 14:06:43 +0200 From: Greg KH To: Jan Kara Cc: stable@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Logan Gunthorpe , Donald Buczek , Christoph Hellwig Subject: Re: [PATCH] block: fix bio_clone_blkg_association() to associate with proper blkcg_gq Message-ID: References: <20220608114528.15611-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220608114528.15611-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Jun 08, 2022 at 01:45:28PM +0200, Jan Kara wrote: > commit 22b106e5355d6e7a9c3b5cb5ed4ef22ae585ea94 upstream. > > Commit d92c370a16cb ("block: really clone the block cgroup in > bio_clone_blkg_association") changed bio_clone_blkg_association() to > just clone bio->bi_blkg reference from source to destination bio. This > is however wrong if the source and destination bios are against > different block devices because struct blkcg_gq is different for each > bdev-blkcg pair. This will result in IOs being accounted (and throttled > as a result) multiple times against the same device (src bdev) while > throttling of the other device (dst bdev) is ignored. In case of BFQ the > inconsistency can even result in crashes in bfq_bic_update_cgroup(). > Fix the problem by looking up correct blkcg_gq for the cloned bio. > > Reported-by: Logan Gunthorpe > Reported-and-tested-by: Donald Buczek > Fixes: d92c370a16cb ("block: really clone the block cgroup in bio_clone_blkg_association") > CC: stable@vger.kernel.org > Reviewed-by: Christoph Hellwig > Signed-off-by: Jan Kara > Link: https://lore.kernel.org/r/20220602081242.7731-1-jack@suse.cz > Signed-off-by: Jens Axboe > --- > block/blk-cgroup.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > This patch should be a backport for 5.15, 5.17, and 5.18 stable branches. Now queued up, thanks. greg k-h