Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4078657rdh; Fri, 29 Sep 2023 10:21:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwuuIDVHdHeALW1prjufwJn8Umq4jCbxbPVAtPNY9uJygBkSSvJfpGfpzRHPs5vFSD5BEf X-Received: by 2002:a17:902:cecd:b0:1c6:2a77:ef50 with SMTP id d13-20020a170902cecd00b001c62a77ef50mr5433231plg.29.1696008078300; Fri, 29 Sep 2023 10:21:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696008078; cv=pass; d=google.com; s=arc-20160816; b=mYn0a9/CdjFcVYk51STo0xf59OXpECYJH6eNG5sid2z/UOlu7CFvbcQxZO2NMyO15N xEbIQzNla/ureHqPRT1anEqoUmjPZjCmqECyOhoZ98gQUUMsVd5Jnu86bIVTPHZe2Pdh P2KyGWA7E1h/PkUZZJ2vKSitKfB8lZ6NCR6pCh3SHgp4fukrXftxIweFSW4qIkvTnwnn eO9l7vqwXS9PYE9mThS5OkvzTW+zM5pGe0QvTY1AtiGt8MNiFI+z6Sq6QxCZPlx+Sb4m qgfJFSVKHoJeDgF4sOjV/qsFyMg4EMeVFeIfW5vJdplI6VYzlXf4BitKkzuduKPaA17K gbzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=31jc2+OVZmwNZGcdfaPyUtUaj9QVTZmwNDv1+AWRPKM=; fh=1iRuEHlOF8pPIIm//KnskQClXHAWQgKYJIM9xXRawHY=; b=Q9uG/nqCJWvrPP/FWKGTnXikh7d8C9Q735GAQPxdRfLONS8m0rY6oMVG9/E/wHAybl FMQlucPvrHevJiU6V9bwu50ILnDvigWagfI7hMMqER7dP/BpYrl76Cqye0zjSDgBguAp 5gftjsffJ/IG+52Lqq+jM1vyOnp14vyHZtjqC/vYUvAIOwcbTPs0JhEMIZIan0plS4rB 7orQ7l9NTa1Mk6kqPruIp6KCFgfJ98xRpGVGgbJS+gIUf+1SAtF/iOjlapNRcx0aK26O gywhgSqQMxRsr401zh/ADaTwL6bJSr2N6GhD1kbBMDkpFxhyC3d6X39JBm4dw1B++hu9 CjeQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Jxup28a9; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=EYt1BgfL; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b18-20020a170903229200b001c62502d9fasi12890076plh.343.2023.09.29.10.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=Jxup28a9; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=EYt1BgfL; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C25DF80DA8E0; Fri, 29 Sep 2023 03:28:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233051AbjI2K2a (ORCPT + 99 others); Fri, 29 Sep 2023 06:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233017AbjI2K20 (ORCPT ); Fri, 29 Sep 2023 06:28:26 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C8DE1A8; Fri, 29 Sep 2023 03:28:24 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SK94P2018441; Fri, 29 Sep 2023 10:28:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=31jc2+OVZmwNZGcdfaPyUtUaj9QVTZmwNDv1+AWRPKM=; b=Jxup28a9iuN3naNKs5NGxS6AVWOPoOLtueYEjtRmqGOh2kqMyhBaOGPv/MlmrxFS1OHv vTA9oVBQNAkCwhwuiaNuJ46kNHoQm58awmrr4D1+pdZ/C294+3HOW7gFlOnnzyWmQfIc R8AO9x2g+0BkCVL5MS6ppNmEFqTyskt98ygYEcCJ/+CdHXIOx7c9fFLLDVGBq7WEaJ4+ 4+fFPwyxB8FwydbNPSAm3qR95b55DGP1ty83O0Xzgwhiuh1tOIWfYW6naXN+fkZ8XaSV zmWlVrmiYetYVNO8Az/1d7vxCkLgUvKhYkKLvhlN7jc6OsPjthVtsNiMxaZ8uXT8kGdh mg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pt3xebs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:03 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38T9bA3r008251; Fri, 29 Sep 2023 10:28:02 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfb83ju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YfmkqUlNo5eNfDTc3E0zA9iJ6Zlmp/eCEwekJJZ+XVsQcx9dpjDwqrCLo8cO//tVXz0OTs4rpR7vONDKTAvBAtCIhXxno2N/Z3jWhZIrhoNu3Y1HXOnnk5bWSeHuVdku3O37MHmPC0YYKDN7ZQC7OxV7dTxxxuLq+AeqJ07yjMNVDeCJQ8QKYfiryfxvOhgebMoIOWinZoDmaG4zLSqs8Lz6fLraXnWB1gXJhcWq2L5n35YRpdxJ+Pls/zqP5F+gnZF3llCbdD4jJOA775mDWLChfx3PRCRpd7BeCRJoNxfY/BoVocCvPtTaqinBxYnEvzmX2w44f38vPwayOghZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=31jc2+OVZmwNZGcdfaPyUtUaj9QVTZmwNDv1+AWRPKM=; b=JGoePJEzJkC8x8PlJ+JPOGak3MTYyYE1lPpfO16AYjg8O3Du7e3E/rL+UKgRtYEbDbOCRfIZLto4C7xSpc2Hyp87dB82htCJu5hY2rPdaKluH9kTsegemBHvwE5GNnCcCWpLi2TaPKJjIWgIWtrmPFgVdijx2Hxp250St44N/3YGopFZetbR9mlENYLDT/LBiAy6eqppOTJMF7wVWSJt5ng3Hm42o/J2sW21Gp2T+M4ysUFpFspux8FDRMh5HJyzGwMPaYVeIUwE7j0bDT/RoBEtF0j9HZgd7LJUuCODz3Ry160DXieKn/FqHb1neE1XuDIUQ17Pz37vF5kzV7JVJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=31jc2+OVZmwNZGcdfaPyUtUaj9QVTZmwNDv1+AWRPKM=; b=EYt1BgfLHjZVRUPeXBGXbGYvx33bG68uo9rKvDCzUIom7CaHr3RyRzEFf3MbVALw4Lzzg+drryoaQSEHiKZyYx/s3c47ceETxdTQ8PssAFfaHQQxhc1NYz2bfRG0WKXi6Nf6V5tz0t+YQNaIL08IPBKvktHYgtjsVgIWFvW9O3s= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB6153.namprd10.prod.outlook.com (2603:10b6:510:1f7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Fri, 29 Sep 2023 10:28:00 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce%7]) with mapi id 15.20.6813.027; Fri, 29 Sep 2023 10:28:00 +0000 From: John Garry To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, John Garry Subject: [PATCH 02/21] block: Limit atomic writes according to bio and queue limits Date: Fri, 29 Sep 2023 10:27:07 +0000 Message-Id: <20230929102726.2985188-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230929102726.2985188-1-john.g.garry@oracle.com> References: <20230929102726.2985188-1-john.g.garry@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR10CA0011.namprd10.prod.outlook.com (2603:10b6:510:23d::12) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB6153:EE_ X-MS-Office365-Filtering-Correlation-Id: 95cb4a4b-7fe6-4547-9df5-08dbc0d6c107 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v8FCtPaMEiYy5IsOdKRmS84vzrA/TkfhBC5eZLJ6bVu978Dk1ZYr/mrd0W1vENMM/jMI6xoWZrsJV2e94A7D2Zidxjz8v+BS/0RrLLt+eohsGhGHMsZQt3/K8GOhT7zLVtqtQYmdnSjEUngU81ph0n6yRlh/mJIQaVME24JxqBLZCH7ApQgUGNXRFDrSvbOp9T+FQYheta2/W6yhrj4jhmOVEzNlnspujyQjUfwlG5y1Q/KKBdK4vSeU5bdboaWkN/zxf4IM8n06vHXkWXqVwLOHOOWJw9uFWNeU8J83Y8+nPwuu7LUkqdNC5kH9G74ooNgRiBYTDULbUXOVrK4ErN6JtYGCR4cY2cDBsh5WRUQjjdZ+ZYmPyujSuDaOdKle+VKh5BmTc04F8Gg9NuvK2co4qWgb3XKlWnh8nmJUJvCZ73SvzrQvgBIqs0Odw4yR0w2LcguZhsB2vRvgZwVNYWXf/SDTu1zv5f+eaudSFYd+/3ogL/7Z5HS4SBTxsOBEVm4BMILmq3yLnfiJQM5/0g2ZDTqoqVHMJ6QfzYJiLWoKi7JwQcFeY8Am7AfOiQtYobTsZA99RDLnAd6oDWnBGBXkRCcqxwgWpcUluPknZ/Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(366004)(346002)(376002)(396003)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(921005)(107886003)(1076003)(26005)(2616005)(8936002)(4326008)(36756003)(103116003)(66556008)(7416002)(2906002)(5660300002)(41300700001)(66946007)(86362001)(316002)(8676002)(66476007)(478600001)(38100700002)(6486002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?w58v2LJ7YEHcZGophxosc5x/X752J19LRNIZZ1vYn1TGq9LoOLC7WDKUfpA9?= =?us-ascii?Q?YJkOYSkyw95bOUlnqSaaCpTFAzLlX3K2EAXQVRQRmGlgqH4gD2VhleMxAJFc?= =?us-ascii?Q?cLXM+R64s/Hm54a7+TnqD90H4NAjwwMFF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80ekK+8rK0F2Na28WlOzodslDrkjmYzbpVi1A2csiMF8j9?= =?us-ascii?Q?qjUP2heKmISqkxWoAZcR5T7iiCGNz/uL4SqOhhE8LdgcknB/OE34wXfc57NX?= =?us-ascii?Q?BhsyCQdIJCu9TPqoWGX7HAOMtXv+4bfpZFMHsSGllyviHpbULZhH6ljzPOiL?= =?us-ascii?Q?oOdgv8zlqbUiq29hBcrdibKV+e9gr4Nkido4SftvI5fhFdY3vywYqhRWY+qj?= =?us-ascii?Q?Zf5LYCqwZotjhCxBc2JGYEG9p41hd6GiY/OfTCfzh7kejnaDnS1szEL6HIVe?= =?us-ascii?Q?crYRGBzg/Of4IiE+XJL5BM1zeihvB4GH5WBpRT4cc4EeS7l9+HzuOL53OnPp?= =?us-ascii?Q?DYPhJTA5Xk3GjeZ/8Tf5fJgh21dhoJdpNTbgcIrfFQTC3lSkKVmnrXnwMrLA?= =?us-ascii?Q?KxeaO8YtmK3cKU/fPXQwClnYIGqyU9e97cX0fRVL9T1uvGk//uv7C1pzMbsx?= =?us-ascii?Q?y5mQDgxVa5F1ctmz797nx7wY+ikgAWKHxo2CWr9zPa7DD5Uko87jNIbxuxTK?= =?us-ascii?Q?PXX69rR4MflLE2Kjx3pDqiVulZQqbR93aQSGAbYdsltaoZu1UlEwyDp/218K?= =?us-ascii?Q?9w=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?us-ascii?Q?0z/PvhbXGt9coWmcU+O7MXB1h/lmDqsixU98t3Qiai0kJXHOGdSuVUo0OKeU?= =?us-ascii?Q?u4pXPi5V7QjPo41d4dArBExQxQoBX505lezFCrjVsAlzUrFFoaKIWmyqWyH5?= =?us-ascii?Q?2k+I3UMqn5aUOsdxjWXMmcRNjKNIRnhFokGkqbCTNt3+28qcZXTnjxasZMCx?= =?us-ascii?Q?aI3n7Q6CsRkvIgB7924L110vu+vQwtaQyGls/5xuOUM+VlxAT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fA=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95cb4a4b-7fe6-4547-9df5-08dbc0d6c107 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 10:27:59.9869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V9q8y2DeiKlJyM0GfMG0V3HcC1KPLGhCre2xoEnjlPLg8ZvhekJiLUEfM3xlHHzwk6l1LCGVMh7DIlWEfwY/8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6153 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_08,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290089 X-Proofpoint-ORIG-GUID: Z_Asfb5nC2yHToOJLMDmUFnYHZcTfEeE X-Proofpoint-GUID: Z_Asfb5nC2yHToOJLMDmUFnYHZcTfEeE X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 03:29:00 -0700 (PDT) We rely the block layer always being able to send a bio of size atomic_write_unit_max without being required to split it due to request queue or other bio limits. A bio may contain min(BIO_MAX_VECS, limits->max_segments) vectors, and each vector is at worst case the device logical block size from direct IO alignment requirement. Signed-off-by: John Garry --- block/blk-settings.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/block/blk-settings.c b/block/blk-settings.c index d151be394c98..57d487a00c64 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -213,6 +213,18 @@ void blk_queue_atomic_write_boundary_bytes(struct request_queue *q, } EXPORT_SYMBOL(blk_queue_atomic_write_boundary_bytes); +static unsigned int blk_queue_max_guaranteed_bio_size_sectors( + struct request_queue *q) +{ + struct queue_limits *limits = &q->limits; + unsigned int max_segments = min_t(unsigned int, BIO_MAX_VECS, + limits->max_segments); + /* Limit according to dev sector size as we only support direct-io */ + unsigned int limit = max_segments * queue_logical_block_size(q); + + return rounddown_pow_of_two(limit >> SECTOR_SHIFT); +} + /** * blk_queue_atomic_write_unit_min_sectors - smallest unit that can be written * atomically to the device. @@ -223,8 +235,10 @@ void blk_queue_atomic_write_unit_min_sectors(struct request_queue *q, unsigned int sectors) { struct queue_limits *limits = &q->limits; + unsigned int guaranteed_sectors = + blk_queue_max_guaranteed_bio_size_sectors(q); - limits->atomic_write_unit_min_sectors = sectors; + limits->atomic_write_unit_min_sectors = min(guaranteed_sectors, sectors); } EXPORT_SYMBOL(blk_queue_atomic_write_unit_min_sectors); @@ -238,8 +252,10 @@ void blk_queue_atomic_write_unit_max_sectors(struct request_queue *q, unsigned int sectors) { struct queue_limits *limits = &q->limits; + unsigned int guaranteed_sectors = + blk_queue_max_guaranteed_bio_size_sectors(q); - limits->atomic_write_unit_max_sectors = sectors; + limits->atomic_write_unit_max_sectors = min(guaranteed_sectors, sectors); } EXPORT_SYMBOL(blk_queue_atomic_write_unit_max_sectors); -- 2.31.1