Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2581460lqp; Mon, 25 Mar 2024 03:27:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWNn93YXwNAS9PBdiJipenkJs8MOA1BFOPyP0LECpYw45Fr0ypY43SPb/7iWV5Lg1WD7h81x/LpuWAp168bKUOnFzAm33/qyWtlQwRKQ== X-Google-Smtp-Source: AGHT+IFSGf0Iqon1+Z4ZSkQGiDEJImWTP3uRskhpO4gTLjXKi4Skrury2CgT9j9GoUAGuOZE5wMW X-Received: by 2002:a50:cdd2:0:b0:566:59a2:7a10 with SMTP id h18-20020a50cdd2000000b0056659a27a10mr5268159edj.1.1711362430218; Mon, 25 Mar 2024 03:27:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711362430; cv=pass; d=google.com; s=arc-20160816; b=sOUBB3cgZeuYhXStELKjtuQtAtJ6XObrNlruMk05iXHolyg+gwsrB3+CagV98P00z2 WZT7QB2ZvP/Mu9pKzqtrWmsyXd4rUyldL9Rbwg3tR3kxSMiw/Rpu/Zb6OEDtDFlJQ1SW P0abJ01vrDVJy4NYSE7QBEohlE7rCyLThz/rudyLwU9ORRmrhbwfBMwh9oE7FWnnUhSb TN7wgw0AmrRDTuCueERV1RMNkWrN7FqLFk4ZT0c3fk6ZNGA0ATa83/DzRzeDkBn1MFPQ bmuYeFQnD6zl3VATZBEOB93iYEEEZ3+MzvoAp2cl6Wq03x7FF9BM2TrZ2DzuCFTdnSkr gOLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4M6Hj/4WhICiI45ft+0KAZ1JYNP1EXkp1K3uTmlAUwI=; fh=JwasWLzX45KWMyubiubl0YZ8g2ygEZwmBm2GQlRj2nY=; b=I2ELER4JlFY7v/ApSeBERNbJCBsdDB9PgJwAwLMsTyg3cOq/0URNJrGQvv/XkgoG8U NDm4OfNon9nkIfyHFNdKyFxZlKzKJWKJMmhjH/XqJKTyxeB5hLXnpyDvsVuIEmbjjs2n Sx2wwbUi1Dhuxw2EsvmAsKktsfAHK5+FH1RdBkuekeGRk8D//0zlAHdenH7bNNhaZjmk OoqaJKaKZ+ntFU3IiaoOZiKqDVSt5IMBpNmebTnsYhW3IB5A3SafXtonVSP3ycD5xgqS GHXcFlGC9Nj35o4uWjeDJlgB1n1jkZSy4i2vVPz0TZQ63T6gis+648yRJbyagXkB1EL7 5Rwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sFCzHHe2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h9-20020a056402280900b00568560d046esi2445658ede.152.2024.03.25.03.27.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sFCzHHe2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8ADC81F3685E for ; Mon, 25 Mar 2024 10:20:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF44D3B4832; Mon, 25 Mar 2024 03:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sFCzHHe2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 552E7282A60; Sun, 24 Mar 2024 23:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323738; cv=none; b=ITMem/HVdnKFyTabE9hM3kA6CymLSzOrzlhgfHZFfEqT+XEhWK/KN5Iasi4FJigIZLxTNFAHGfl5p6JPDPBW/0xLFQd7C4dVIKqh1fRfO8zmRPTuiLMMf0SKpcsie7IHwSFj2Xhk30pPnPd7u9wFMz6fzO7e8bFguHrZrEgaIHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323738; c=relaxed/simple; bh=KM87Xwe8+UKkpGiWc+ZVcMH17sbsmgKLsPwheUARK3g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AtH+bUyw5nlDlNcVsOqYXHhqyjCcOjcaacR8e7gQoQ1huaIgUecA0MUryIIAD06XPwXjDlGTkDmJkB+U6tm+3ROc1IoTF10dmowtWcRlJb57pU99wFboL17OzB0V8h/YPq6aZJkib1LvfErZiKBqSQxPutn6WpRCIMCh95U11ag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sFCzHHe2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BE87C43399; Sun, 24 Mar 2024 23:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323737; bh=KM87Xwe8+UKkpGiWc+ZVcMH17sbsmgKLsPwheUARK3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFCzHHe2fIairCOZEMwh8LSFWRuTtz84hJxz7HSSYVdT4unrj1/KDGIk8OERFB7dq PHz358rPm2Oj7WJQ0EPGWWtOrn8NCuoLHukSU6oB3H3WTRTWV1Zlz+VKQm4rV+j+N1 ZZdYETq1Mh4VYeApslFjYdwgBTzvyjWeoxO+vjzvGV3xZtqabwb4nVcAngOVZinuZH 6Duiugh65D4gQcOjfjmjU5rb/QiJwmc6LMTkgObk4VrKZy9zzosonTn0VC8UZbK68+ MzimEjfQe7uXREX7i6WNk/EL9DuQgeIkOY+coKqJncBsz7vWodtKTzHYSJRXOYvUrY 878Mel1jAr6vA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ming Lei , Patrick Plenefisch , Mike Snitzer , Sasha Levin Subject: [PATCH 5.10 111/238] dm raid: fix false positive for requeue needed during reshape Date: Sun, 24 Mar 2024 19:38:19 -0400 Message-ID: <20240324234027.1354210-112-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Ming Lei [ Upstream commit b25b8f4b8ecef0f48c05f0c3572daeabefe16526 ] An empty flush doesn't have a payload, so it should never be looked at when considering to possibly requeue a bio for the case when a reshape is in progress. Fixes: 9dbd1aa3a81c ("dm raid: add reshaping support to the target") Reported-by: Patrick Plenefisch Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-raid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 140bdf2a6ee11..e523ecdf947f4 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3329,14 +3329,14 @@ static int raid_map(struct dm_target *ti, struct bio *bio) struct mddev *mddev = &rs->md; /* - * If we're reshaping to add disk(s)), ti->len and + * If we're reshaping to add disk(s), ti->len and * mddev->array_sectors will differ during the process * (ti->len > mddev->array_sectors), so we have to requeue * bios with addresses > mddev->array_sectors here or * there will occur accesses past EOD of the component * data images thus erroring the raid set. */ - if (unlikely(bio_end_sector(bio) > mddev->array_sectors)) + if (unlikely(bio_has_data(bio) && bio_end_sector(bio) > mddev->array_sectors)) return DM_MAPIO_REQUEUE; md_handle_request(mddev, bio); -- 2.43.0