Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4513375pxu; Wed, 9 Dec 2020 20:54:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+efi54N088VwazZQr8Pq8mw0f1gVdfBsAW4tw/kRtonvh5gjAFTbZUgDZ1mEUH8fH0r1l X-Received: by 2002:a17:906:3ecf:: with SMTP id d15mr4822165ejj.297.1607576051436; Wed, 09 Dec 2020 20:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607576051; cv=none; d=google.com; s=arc-20160816; b=G2xX/N80Iz8Ay3FnU/IloXv6HzbP6ebnoJ8h80nykth9rQ8ivj4c08M5FEfKM6yP0l WPhIv5HL3BkUQ4pmEz/yXowXkrKm/X7y74P0z5YmuB25gmPqpVIYXGezg9hvUTlLNwtY 46+yO+GTQgJTI6qz8aS8Ntej0WuvcF9G9c114PAw86EwAgx2p+dnbzn49BHaNkNodyfH aEBoJA2NlC0KonTx066shQqkEzjYrxFV+Tt9zFs/JBSeC344djnWUMjNf7awrEQcrXBX pb1oskpj+sxkd4euNkT1HU7IGmaTzotDSYMlYn1i16ZrYIs33y9O5m0uxpG96Po1rP9D BMBQ== 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=cSrpEENT4BnIOutizsuJT3GtR1FFCTPvbLdR2uZhziE=; b=I72FUQ7uSMVHScZ0HxJ1mpiDn6j28Zf67/hgcczf4jeO2JHSg+MoOssC7LrVyLcUil UcVrKBL8J2ztwoUSxBwzQYO9IVeeyPBIibZTeqYoIZnxBknlIvCwcHKJX01Yn99BhSWw GkxqXB4oySGfiDbqVy/x6/v0mpcj5P28/8lS0NK0g+6quUFOIvQTt9qTQBwRCqZ2//rY joICoJ58iNUpNxUZ8bCpFhZR2NTnEzWmL5zuE7U6fcEccuaHkkx6wiCtjZGwUdcTx9Ft 81XNcpzNJMqbdgs8zARglvlXn5lN8S7SVGxkhQvH2N+lYewTAKDADq/Luo4SHsuGmWcX CBcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X9k3SUCu; 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 q4si2006437eds.576.2020.12.09.20.53.39; Wed, 09 Dec 2020 20:54:11 -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=X9k3SUCu; 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 S2388577AbgLIWiW (ORCPT + 99 others); Wed, 9 Dec 2020 17:38:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55026 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389017AbgLIWh5 (ORCPT ); Wed, 9 Dec 2020 17:37:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607553391; 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=cSrpEENT4BnIOutizsuJT3GtR1FFCTPvbLdR2uZhziE=; b=X9k3SUCuk/SgPtrKZZ31Iu/xNDA8HyDmEZDPdWFjMmgVIo05lD9FFEewzeZvXyt9Le9cyR aYvFh2QWW4jO59HMs4rRiUelV8Or5Iy2w/Vl4pPgiAt3ymytcCbOCkOJSirhr/K5znmP7F SbYyyxKDkTYxF90joVsZJfptm/932UM= 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-176-hfsCSptnNgifgsVVCKkZLA-1; Wed, 09 Dec 2020 17:36:26 -0500 X-MC-Unique: hfsCSptnNgifgsVVCKkZLA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 430AE8712DA; Wed, 9 Dec 2020 22:36:16 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA11D5D9CA; Wed, 9 Dec 2020 22:36:15 +0000 (UTC) Date: Wed, 9 Dec 2020 17:36:15 -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: <20201209223615.GA2752@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.14 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 If you're reverting all the MD code that enabled this DM change, then obviously the DM change must be reverted too. But please do _not_ separate the DM revert from the MD reverts. Please include this in a v2 pull request to Jens. Mike > --- > 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 >