Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4322246pxu; Wed, 9 Dec 2020 14:08:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxKfM6PE86VftpXZt8nWPZ58IbYTV1z4OT2fVT3lBhl56MMD8I8v9bw0IIvBYwsljeIHgW X-Received: by 2002:a50:d5c1:: with SMTP id g1mr4035657edj.299.1607551687115; Wed, 09 Dec 2020 14:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607551687; cv=none; d=google.com; s=arc-20160816; b=eL26CZsTJNRUEIoj91k+LgHLfdQVtMwkmRAoMBgfLvvYkPzJTotFZb5y6KMKX+2vZK K0Zm2rh6RFQQJ6brDUWze5utadWpQfPpgciZMU7oZBRCvXgIOzLP4j8ZR8BsKFew7O9f qQWx12NM4lijwPlRy+AS9L471upiLbDBtxeJAjsJIQkqSAY9i4D1wOwbXlBlNWfsoaGd 28P7JoEqSu70lm3RRLO6pX8XAsmqt90FgZeDD0s3Jr+by5oasfN4sHYnU6/z40rx1Bhq jvZeMwWw4SsdtkWO332W15O1VhCqIn8kmPwVEqP9i4VCTw1kTwQ7UKbfEmYi641m/CVn 2ZrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=Kt4gFE5XwRUbIun+h1fyNNxFgIka9LB8tZNlBDhL61w=; b=PbfnNiAzHiw/nD2KDi6RtCf/6j7C3bLq98YtftCtZp7mHAtAbRMLQ/PpNmRk6X4prB Sb9/MQH3lBAYlEImycNdLnM5C6W2cmCTjlBddbEHO4r2ZzfG0ZGR0TPUKHvWt6WarXf5 jFWY1cs09oV4T7pZC27Y8BwVokSEVxb0AiffHOyRyXIl658XGMdAA8ZnIUseBInpL6Ce bt2j31gqkxT2fl/L2/VLPULrDRX226Po8ip+LSwizKPVOCbibZs4W9zMb6mlmisaOIer oodanNarrsH/YI9sfoh51kMVNanczeI5FJE1Apzui9nzJKeVyE2rnVwu0kKy6LY6SETE L2Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=QN8bXjjM; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz21si1462914ejb.604.2020.12.09.14.07.44; Wed, 09 Dec 2020 14:08:07 -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=@fb.com header.s=facebook header.b=QN8bXjjM; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388436AbgLIWFC (ORCPT + 99 others); Wed, 9 Dec 2020 17:05:02 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:27608 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388421AbgLIWEv (ORCPT ); Wed, 9 Dec 2020 17:04:51 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0B9LmOSH011265 for ; Wed, 9 Dec 2020 14:04:09 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=facebook; bh=Kt4gFE5XwRUbIun+h1fyNNxFgIka9LB8tZNlBDhL61w=; b=QN8bXjjMa/3Oq1mMdLd367L3cCecd/KrPnu81vEMgP+BIB2aI6pIIaArBbbVMosgRTqy PJpBeXx+GVeyfpwkNADz0S5C+/q67hKKrCRHRPZ3txLXYjp+16xcwTDW4r1mxERGRMRF Kwq5XrH7/l9e+cvOOCIDxPFAbMq01wohkt4= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 35b685gb3w-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 09 Dec 2020 14:04:09 -0800 Received: from intmgw001.08.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 9 Dec 2020 13:58:45 -0800 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id 9C5F362E51F1; Wed, 9 Dec 2020 13:58:22 -0800 (PST) From: Song Liu To: , , CC: Song Liu , Matthew Ruffell , Xiao Ni , Mike Snitzer Subject: [PATCH] Revert "dm raid: remove unnecessary discard limits for raid10" Date: Wed, 9 Dec 2020 13:58:14 -0800 Message-ID: <20201209215814.2623617-1-songliubraving@fb.com> X-Mailer: git-send-email 2.24.1 X-FB-Internal: Safe Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2020-12-09_18:2020-12-09,2020-12-09 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=822 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012090150 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, stru= ct queue_limits *limits) =20 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 =3D max(chunk_size_bytes, + limits->discard_granularity); + limits->max_discard_sectors =3D min_not_zero(rs->md.chunk_sectors, + limits->max_discard_sectors); + } } =20 static void raid_postsuspend(struct dm_target *ti) --=20 2.24.1