From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796042686; b=sTvTruxxUi2YwsUhMh9phD9ORBWFpJEimz/jeWDGe/sdm3nJJbwd7FxpLKNaXozhMGpQ 7oQaPb81IoWWgAiEBtN2+ASeKZiHyZauFcQq1RbjzikyflxfCxHzsrnpfyRySa1lZcdkb XoEjG/j/sy/Kx6xHOTbjF3B6u+2KTKlXUpwzoZIHK+cx/aC1cDYhFV8GaasYCI8KE2nd+ XJrj+VxOv5Q2mpeWyhcnjhIOxJE8h1opdgCqS22HHGiC4Pm93dFVvjltWrdxKDRP1aZwf T/LKbEYA29uFGtDoEWp9b9ARYCwGmebQonrRRKGbWDItRuZ4RA4rjXucgXRJptx5f4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796042686; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Date:From:To:cc:Subject: In-Reply-To:Message-ID:References:MIME-Version:Content-Type: X-Scanned-By; bh=OEkDU4J9zDjGcmY2HR1fWE1BQuIBKRcLx713vjiE7pQ=; b=O51WbSskS7xeK7Nmn7wwgfqr4tNXQQzx2HUr6vEdfIrkyv2RR7lMqNMaU1ZU6AAdNDXo p0VD8U5nez1xFK2ShaVHdGS6BHD490d4IsUtBbHkzMMXbjEbF4MM//WRjnJgBNeYd+BxI BlXux+t2DqIVkVIq8yBLe1duRiwTkamlGyk+X1uMWMvyqKgyhQKK4DspQ062bDpXcM8Jx Fm7YwU8B874SyFjUpurZDpzKyLJptGrv2CmHj3efgsfKZUv3t5DEWe5aLyDV0se78Kpth diH1DXBZbN5J0pW/nz1lRg6D/Aq+DBTIEZgkXJ2CCdU4tf82R+leTWuKWhki8uZ6jtA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aNHdmurY; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D2ED606A32C for ; Mon, 30 Nov 2026 12:44:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D2ED606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aNHdmurY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796042684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OEkDU4J9zDjGcmY2HR1fWE1BQuIBKRcLx713vjiE7pQ=; b=aNHdmurYSc4I/4zpUTTMn3KoR7zb2ZQoEhtR0PrRLuNvr9SO87atoW+jzzVmk9qHLabB/c B6kgvs4OqrQ1G9XFQ+rMfvKFNeoShXoPPMtaPaDa2SSaxlMJrQTFG7N6nMdlr9Wjjg1LW4 b7w6zbEU/OkDBmeG5YLTPVMzDuK3Mxs= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-OYowx5bxO42xdBr-Ned-cQ-1; Mon, 30 Nov 2026 12:44:41 +0000 X-MC-Unique: OYowx5bxO42xdBr-Ned-cQ-1 X-Mimecast-MFC-AGG-ID: OYowx5bxO42xdBr-Ned-cQ_1796042679 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F334618004FF; Mon, 30 Nov 2026 12:44:38 +0000 (UTC) Received: from mpatocka-thinkpadx1carbongen12.rmtcz.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 80F2418004FF; Mon, 30 Nov 2026 12:44:35 +0000 (UTC) Date: Mon, 30 Nov 2026 13:44:33 +0100 (CET) From: Mikulas Patocka To: nenkov2004@gmail.com cc: yukuai@fygo.io, linux-raid@vger.kernel.org, song@kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, magiclinan@didiglobal.com, xiao@kernel.org, neil@brown.name, agk@redhat.com, snitzer@kernel.org, bmarzins@redhat.com, syzbot+8b22a0459202f76b4096@syzkaller.appspotmail.com Subject: Re: [PATCH v3] dm raid: Clear MD_RECOVERY_WAIT on reshape setup failure In-Reply-To: Message-ID: References: <4d13edef-f454-437b-8910-3a905697303e@fygo.io> <20261120111757.4705-1-nenkov2004@gmail.com> <20261120111757.4705-2-nenkov2004@gmail.com> <38e795e8-9c96-43b0-b1c7-d473f6519b83@fygo.io> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463801984-66525651-1796042678=:2220361" X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463801984-66525651-1796042678=:2220361 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Applied, thanks. Mikulas On Sun, 29 Nov 2026, nenkov2004@gmail.com wrote: > From: Hristos Nenkov > > rs_start_reshape() sets MD_RECOVERY_WAIT to keep the sync thread > from running before the table reload. If setup, check_reshape() or > start_reshape() fails, raid_preresume() logs the error and continues > without a reshape. There is no reshape-related table reload to wait for. > > Clear MD_RECOVERY_WAIT on those error paths. Keep the bit set when > reshape setup succeeds. > > Fixes: 644e2537fdc7 ("dm raid: fix stripe adding reshape deadlock") > Suggested-by: Yu Kuai > Link: https://lore.kernel.org/r/4d13edef-f454-437b-8910-3a905697303e@fygo.io > Reviewed-by: Yu Kuai > Signed-off-by: Hristos Nenkov > --- > Changes in v3: > - Add the Fixes and Reviewed-by trailers from Yu Kuai's review. > - Resend only the dm-raid patch. Yu Kuai has applied the RAID10 patch. > > drivers/md/dm-raid.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c > index ac019a0f5..e132951f3 100644 > --- a/drivers/md/dm-raid.c > +++ b/drivers/md/dm-raid.c > @@ -4004,7 +4004,7 @@ static int rs_start_reshape(struct raid_set *rs) > > r = rs_setup_reshape(rs); > if (r) > - return r; > + goto clear_recovery_wait; > > /* > * Check any reshape constraints enforced by the personalility > @@ -4014,7 +4014,7 @@ static int rs_start_reshape(struct raid_set *rs) > r = pers->check_reshape(mddev); > if (r) { > rs->ti->error = "pers->check_reshape() failed"; > - return r; > + goto clear_recovery_wait; > } > > /* > @@ -4025,7 +4025,7 @@ static int rs_start_reshape(struct raid_set *rs) > r = pers->start_reshape(mddev); > if (r) { > rs->ti->error = "pers->start_reshape() failed"; > - return r; > + goto clear_recovery_wait; > } > } > > @@ -4037,6 +4037,10 @@ static int rs_start_reshape(struct raid_set *rs) > rs_update_sbs(rs); > > return 0; > + > +clear_recovery_wait: > + clear_bit(MD_RECOVERY_WAIT, &mddev->recovery); > + return r; > } > > static int raid_preresume(struct dm_target *ti) > > > On Sun, 29 Nov 2026 15:15:54 +0800, yu kuai wrote: > > 在 2026/11/20 19:17, nenkov2004@gmail.com 写道: > > > > > From: Hristos Nenkov > > > > > > rs_start_reshape() sets MD_RECOVERY_WAIT to keep the sync thread > > > from running before the table reload. If setup, check_reshape() or > > > start_reshape() fails, raid_preresume() logs the error and continues > > > without a reshape. There is no reshape-related table reload to wait for. > > > > > > Clear MD_RECOVERY_WAIT on those error paths. Keep the bit set when > > > reshape setup succeeds. > > > > > > Suggested-by: Yu Kuai > > > Link: https://lore.kernel.org/r/4d13edef-f454-437b-8910-3a905697303e@fygo.io > > > Signed-off-by: Hristos Nenkov > > > > With following tag: > > Fixes: 644e2537fdc7 ("dm raid: fix stripe adding reshape deadlock") > > > > Reviewed-by: Yu Kuai > > > > > --- > > > drivers/md/dm-raid.c | 10 +++++++--- > > > 1 file changed, 7 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c > > > index ac019a0f5..e132951f3 100644 > > > --- a/drivers/md/dm-raid.c > > > +++ b/drivers/md/dm-raid.c > > > @@ -4004,7 +4004,7 @@ static int rs_start_reshape(struct raid_set *rs) > > > > > > r = rs_setup_reshape(rs); > > > if (r) > > > - return r; > > > + goto clear_recovery_wait; > > > > > > /* > > > * Check any reshape constraints enforced by the personalility > > > @@ -4014,7 +4014,7 @@ static int rs_start_reshape(struct raid_set *rs) > > > r = pers->check_reshape(mddev); > > > if (r) { > > > rs->ti->error = "pers->check_reshape() failed"; > > > - return r; > > > + goto clear_recovery_wait; > > > } > > > > > > /* > > > @@ -4025,7 +4025,7 @@ static int rs_start_reshape(struct raid_set *rs) > > > r = pers->start_reshape(mddev); > > > if (r) { > > > rs->ti->error = "pers->start_reshape() failed"; > > > - return r; > > > + goto clear_recovery_wait; > > > } > > > } > > > > > > @@ -4037,6 +4037,10 @@ static int rs_start_reshape(struct raid_set *rs) > > > rs_update_sbs(rs); > > > > > > return 0; > > > + > > > +clear_recovery_wait: > > > + clear_bit(MD_RECOVERY_WAIT, &mddev->recovery); > > > + return r; > > > } > > > > > > static int raid_preresume(struct dm_target *ti) > > > > -- > > Thanks, > > Kuai > ---1463801984-66525651-1796042678=:2220361--