Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4340442pxu; Wed, 9 Dec 2020 14:44:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+eCMBOnXkPwmtjJUZeJ5YTxXfp6lOrtjVUzGm08Vj9fJYQpPGJ6m2jIc/SBPXel0gn7Ki X-Received: by 2002:a05:6402:895:: with SMTP id e21mr4126433edy.284.1607553880156; Wed, 09 Dec 2020 14:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607553880; cv=none; d=google.com; s=arc-20160816; b=h0wfAnLzlmVSsTrDtpGl/yiSHaGT7Djh3EDoACFRSAV9G0nh7ZJNuGch2UqUFIt9zp Xq+NfHTC6I2SelrBZLz2k27dWY6jJNDx3yO4pnXafaQWwGgL7QU7OjRAl2g1nkmhF4zX vIG72oPC0FMvB8p7H4Z6EFhgPb2paU0fIx+FLbhwv/wxZX8ugfZ/WSPLsq1iBAGSaoQJ YJC1Uc6AbdzU0HOYWZl4FZ23SQb0HSVlBvBqIIzE2KVBcXGKinntFv8VUkS53sChQkNf rAF4Q/XdeBLmiP0MRpwvZOGgE8T0eKv3eXcTvkLsOLQJJS2jS69P/zoBJnwyohz7+32g 3yOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pLh08CODrTtOHr1xQAUm+7JhxhEsEXmLpw4HRIcM1tc=; b=hwt7G2fECwiZL8zsbR6s6AkEXymRD9uriRQCcRX7ueI5yqQZnwvz0qGy3APjCr3BU9 YFi5P6OldQ18jYTnfCTCsKmeantKSSwYbYBLqstpdhp/VjkN5kVIHjXhSxEB7sOQnSZJ HqzhnukVOW1NzUNMbITyt/F9a0cMfR5hYuGQnFp4fHw0265Tytj4Tx4lis1b2LVIH81p 3sJr4SYd/NOYBgbjUnyL1zf9hcBnXAkNkkoic1qhl/AWI/pMABjR+4iP960akh+3cVHc 1Y6gtXhNnSJyI39eKEMAosraBjpSzBlXn9MduyhlyNSkLIfbEKgL/DijALjBzDCXA/qK dYvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eIdevc2h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si1492492ejr.334.2020.12.09.14.44.17; Wed, 09 Dec 2020 14:44:40 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=eIdevc2h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389053AbgLIWjx (ORCPT + 99 others); Wed, 9 Dec 2020 17:39:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38691 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389044AbgLIWjv (ORCPT ); Wed, 9 Dec 2020 17:39:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607553503; 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=pLh08CODrTtOHr1xQAUm+7JhxhEsEXmLpw4HRIcM1tc=; b=eIdevc2h+X38oXj8nZiNyVvrKd+20hGcX3WsT3sR6Cajf7ezWTHl7xFA8rx4tCc2TELZgQ cojXGjCvW55cRXfblHoloFUyLOdSEZr+QnUzZM35+0iNBaEJ05vmE/86lF9RQZieDbiNTh 8r4u+qY66t1l2fztnNvpkAuhR9vvKpo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-NybBHuTDMeSb_WVQBgiOJA-1; Wed, 09 Dec 2020 17:38:22 -0500 X-MC-Unique: NybBHuTDMeSb_WVQBgiOJA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E56866D53C; Wed, 9 Dec 2020 22:38:14 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA4216F990; Wed, 9 Dec 2020 22:38:02 +0000 (UTC) Date: Wed, 9 Dec 2020 17:38:02 -0500 From: Mike Snitzer To: Song Liu , axboe@kernel.dk Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, Matthew Ruffell , Xiao Ni Subject: Re: Revert "dm raid: remove unnecessary discard limits for raid10" Message-ID: <20201209223801.GB2752@redhat.com> References: <20201209215814.2623617-1-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201209215814.2623617-1-songliubraving@fb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09 2020 at 4:58pm -0500, Song Liu wrote: > This reverts commit f0e90b6c663a7e3b4736cb318c6c7c589f152c28. > > Matthew Ruffell reported data corruption in raid10 due to the changes > in discard handling [1]. Revert these changes before we find a proper fix. > > [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1907262/ > Cc: Matthew Ruffell > Cc: Xiao Ni > Cc: Mike Snitzer > Signed-off-by: Song Liu > --- > drivers/md/dm-raid.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c > index 9c1f7c4de65b3..dc8568ab96f24 100644 > --- a/drivers/md/dm-raid.c > +++ b/drivers/md/dm-raid.c > @@ -3728,6 +3728,17 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits) > > blk_limits_io_min(limits, chunk_size_bytes); > blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs)); > + > + /* > + * RAID10 personality requires bio splitting, > + * RAID0/1/4/5/6 don't and process large discard bios properly. > + */ > + if (rs_is_raid10(rs)) { > + limits->discard_granularity = max(chunk_size_bytes, > + limits->discard_granularity); > + limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors, > + limits->max_discard_sectors); > + } > } > > static void raid_postsuspend(struct dm_target *ti) > -- > 2.24.1 > Short of you sending a v2 pull request to Jens... Jens please pick this up once you pull Song's MD pull that reverts all the MD raid10 discard changes. Thanks! Acked-by: Mike Snitzer