From patchwork Thu Jul 18 08:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 813224 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11022116.outbound.protection.outlook.com [52.101.66.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 716AD12FB0A; Thu, 18 Jul 2024 08:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292336; cv=fail; b=ohfH3xGJUxKvgkrKU3WOWWyN5+qyHfYp2ZzlND0IIKMl3aVDJT04sIdcZO+eoLTT9IjvfDHNl/hGGk5kZtdjjV3iCXAzAid3RGQyu+0t7Ai/a1fpmBdM8H08vmhR8ugFuBnT59j5nn64guPpccfi8OEdX8G6CdhYywTBIoaU1Vg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292336; c=relaxed/simple; bh=JvGJVB2TWQx07cYj81j3WvS5qO3qZipt7/2iFRhd/2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=hILXToZYEu18KfUmNVt6L5RjZhLlTdVGRkjVT5AJaAgspbS81JFKi/AKcBPBaZT/l2ChmmW1q9HjBp2X01uUOLY4oKlplDHeTGQeLxKUlhqVmQr0KyKO3TBrkp2N7aO4ylG0Hmjpd9ew6YZLVhB1+hYOSSVlRs9llfqv0oIOdqo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=iYOIJh8R; arc=fail smtp.client-ip=52.101.66.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="iYOIJh8R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=se4CLOYxim3/XaDVgOJXo5foM3fVXwIYk8CIlmIhXyE099aL/WfvbQUNUG6vWj3tMQebAuN87ocMWDI/eUyW0Ti9zuvcWh/fozsXMYSQ8mJPTq5AM1JXdcGjVhevoHH/RiwFtK+tg2uZhz9hpfMSSSz42cpbSud6IXqgBYxPNgpxHvXxJwqoLTtBpmER3GKJri+oJVkqfQePjavJtnMgwG/ts0bX2q94dagNQNqKk6FHjwvIVHGXMUtCb13kz0VOWru/QeekruyZCIBAHaNzCoy5QHHpffMyEdbz3IP/HlxbDmDgtXOPiOV7zULcHCFtdnA2kWma9r53OdY1KIRLYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NpEc9IbUa5kZ/1013u1ORU9PTtVQZpUlS3RuXqB7dzo=; b=KS+WOQIXasDdSxY2V4lB/epLpo0swlVDivRSRtRRVJWuOn2OYMK8K5hcCHUM28ueUcnJlwNjb/t00ZsmbxKU8D+lSNWkJcp3rdx45wDUoSlHK6VJSVVHI6DM7/uO1Ic2VB13FRxAlyVeW8De9RftIaQr4FV8HPCjUeNczMFIUOIott2ChTcaLAM+lPGDn1ct3Jp/+shR/LC3jiH6ZGuOdKqRInjMXB2sfk7FmO4jlGxtRs4z1JQ2oMyL0P47qbVAO2Egu7JdFT8s3TJFvfOPUqnjOeSqWQKfHdzV0OcvapawUWFRlNxVSUHDHGbSfbG3aE+LeQ8NhNlowMksdrnKqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NpEc9IbUa5kZ/1013u1ORU9PTtVQZpUlS3RuXqB7dzo=; b=iYOIJh8R5f+Kd0sXrf9FfZkIYMjytDWBSgI+VVX0jmNBK8NFvvB84B3uUTPJTt4UyvER554iPdBiaucM4DcNiOUo5nEwxU4295NUX6C5uBwLHfUhfoyXYpjbmfS/9bM9XvQF9s0CaOo3FknMnq2i+Btua9/YSpFSH7GXtHP61ovWskVwy/VPujaEInpAB760m8H9ttwaT6aRAnWaKyPBxOsM9kI1ih1o/2sCYj2Sr0TA4PBxU8i9/Qcj660uFRwcOB4HWo21Trk88dy9Jl/Ijmh8Q0JgnMCAljPiIGGMnpy0DeTtWQnqyu2YC+JzSLcNkcWwD66sUZQ72OhrRuGfdw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by PAXPR04MB9005.eurprd04.prod.outlook.com (2603:10a6:102:210::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Thu, 18 Jul 2024 08:45:27 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 08:45:27 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v5 1/3] net: introduce helper sendpages_ok() Date: Thu, 18 Jul 2024 11:45:12 +0300 Message-ID: <20240718084515.3833733-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240718084515.3833733-1-ofir.gal@volumez.com> References: <20240718084515.3833733-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0030.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::16) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|PAXPR04MB9005:EE_ X-MS-Office365-Filtering-Correlation-Id: 5453f723-6ed9-421b-4a1c-08dca705f8f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: jZeKhkK8EotUN44Jn88kYDZF5CUUDGxocoxmoklIThdGIDySiqglFXqtahA8kbUihirSf5EPPeVBESLP4d4lKAanj3HcJjR29sRbWqK6S+sHRRdo52aPW/vd1/dpir6NXmxxeiGuYS+P0PYWO0J+6TWLv+anfOGrrOmSKXxxAgrPy83zzTzyVYS3IuwlOiqI0dQlhNph+qezOJiZdijIA6LH/oc5SZ8zPwVXcxyG+/PIyC8EsW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HWPFjZwWvVaPqNlbL/rzXll26bnnT3wSIyk6+IL1YwH+TlbnzXO2P+vCwn8zFdcjGm9q69Bi7YtzbMqpXfB6K3egRC2nlaoQaFFuhFe8MAkRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8344.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 78SF13xGFqv/MpOUDZs0783xW1eN4x4n45xCbyYtTRRhMvWjeYwes75qTsm6ps0ruVlj89il6yqlhsMjQE8UhjJAFN4DbxDhCA+v+YJHydEOM4jMlJvRAJ6HeD6n+vYLmXl+0vJtxawP8WsnnjvLpIQ0HS2rd2+V2+9vddILYiP9C2nmQYgNAaTBc6BcuPtzmQWY6kT3m3JJNuJFHlHvnZZXFTgCDrAP58CO86q2bqd+14YW2yxSd1o9cYtnmaTXilqqYX6dHDSnWkrmqkVkV2j3UkE+8raIRMPRBRLQgCqLKlYqTW0apebqJcNGnhjC5O5LCNk4F9DXc/7RGBgJHxgMwo11ZNegdhSe8bVfRxefrp2l3gKLA5dySNy2vca+1DK2FSTSntG9aHfqsMzpDvw9AEm+b4vf1lyCUa9aEmd+08PZMP6ASWtA6lPejTh0dEAeBjd+E0VW4h0m+RuRFdI5opp8UJjY2ePayW11pBsnvW2rMYHHzGk6q0VnX3YHr27lnZPjLwJ40JdRqv/wBa2aIQqKlhMOG/p4EZUqraolQIyD5OKoSdg6SrFMGQBK4Dn5Y8ivLZvCjWRR4hQoK18R6aNBkhwc+R5CzWMgkDjs2sBrkKzXRqfg+o+zYpHgdRK6zyTGdjIMJipus39mSsjPewX0dWccziSyxSNYiyHBLEjbUJOSaXgdkZizAcBweZWRorZNHcHgssyl/gq8HybDt0jDxuKqfRHyS1N6+0CGEckcksaf+8aPVy0zjmflwlMfvWmpjg8f1yl6VS58kkBEHKk6wpVEqojtpmvc+ZJeGy3CD6TvO3eGJBUS3ukZx6kxOgjTDVozAFKAbQqrMIHPs+lUnf61F18TKvj6fGWBtKho2bVsHZWB6k7NWA+LIo13XPrLeQ1oHjtaKD1APTZR3HskjRdZqOBdY/9bY2XtlAEZVzibv0vIOXUid0AILci020Xo3S/KvUb1yOEa+w0gMzfpSx0HsdMSphwve6jIAD4R7HGECaMkqDhS5Rz1q51C/4YJiPa2jkZgsXjP/oMrmoPVM4/l6huhqyjlpB7W4IrtGsi5RgcRsbU2Ng0NnYg7yaDS/FATmz4dKWjLZ245Mw44xlJIgPy3oxO7PCu9L0f2zH8jUrYmx4cREhMTEFiZpTHzMOrKPodufZ+YBGhGXJXNzj3gphlFtAntgQiAIJDWX/6FdK9i5as0duxV+/q0tB0/9odJhs8lY4ZT53veQBTzk9jaGVUu2BBhESAsjE9Alt+Kv5xNdfDKH9fjki8E489VavwvN4RWQX30JNkEWAx3jtbr2X3UK4d5VCHitsQpkWdBWZgdY37fZL/ZKq/2aohCo2ziZDt1wZZ+MssSKywtypB1bydO/T5tanwh5QbVgR/u2ytkscmOdCeusCkFdgGeb1hkWQmgpB8L8tfAlTeBC3bzqWHvS6g/Jy1e2YdSxiuSHF/I74dcZttlYWZPmNxfn9DQolfvsWsIVdzky+BXvskLX7uIAoW1Rs01WWKdPh6Jf1CkMbmBAMcw4NhrL7ZJX10c0l6iiK73wZ5GMQ97zcVI27n7ud/YJZZ3q5iRU4xrIG1eeGthu9Sx X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5453f723-6ed9-421b-4a1c-08dca705f8f7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 08:45:27.4297 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kcVd67n/6a13P6SnNwdYq2/fLVTgaGWlvdKSWExGf9Efz5imAXfOOh7j/jA0ScK8CBM7xTMG3PYJ3FARGjTjOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9005 Network drivers are using sendpage_ok() to check the first page of an iterator in order to disable MSG_SPLICE_PAGES. The iterator can represent list of contiguous pages. When MSG_SPLICE_PAGES is enabled skb_splice_from_iter() is being used, it requires all pages in the iterator to be sendable. Therefore it needs to check that each page is sendable. The patch introduces a helper sendpages_ok(), it returns true if all the contiguous pages are sendable. Drivers who want to send contiguous pages with MSG_SPLICE_PAGES may use this helper to check whether the page list is OK. If the helper does not return true, the driver should remove MSG_SPLICE_PAGES flag. Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Ofir Gal Acked-by: Jakub Kicinski --- include/linux/net.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/net.h b/include/linux/net.h index 688320b79fcc..b75bc534c1b3 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -322,6 +322,25 @@ static inline bool sendpage_ok(struct page *page) return !PageSlab(page) && page_count(page) >= 1; } +/* + * Check sendpage_ok on contiguous pages. + */ +static inline bool sendpages_ok(struct page *page, size_t len, size_t offset) +{ + struct page *p = page + (offset >> PAGE_SHIFT); + size_t count = 0; + + while (count < len) { + if (!sendpage_ok(p)) + return false; + + p++; + count += PAGE_SIZE; + } + + return true; +} + int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t num, size_t len); int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg, From patchwork Thu Jul 18 08:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 813540 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11022116.outbound.protection.outlook.com [52.101.66.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92EFA13790B; Thu, 18 Jul 2024 08:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292338; cv=fail; b=UecuYQ2AFcFGpz35Qn/2/bLs5w0kHXJXBAzHcyi/Y9sjfuzX3Ky4vfrDTY9sn2AnmGDSuI8Kq0VhApGIWdA4qPyA311STXiX3XBMtotX6lCaaqGBDOLPA26nFMO+d8GJPwTHEC9ok1l/PDLQkEKz7rNv1eEFWhT1DpynHZnd1tI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292338; c=relaxed/simple; bh=wYZQ26y0os4R5zRsiqzIRgSNnbiRuxC9GerU31GCTcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=rdZWIQUjSA1Fwxekv88MipD1jArPAuiZIsMSgEN8NR/IV08seile8DoRM+088OzmCc5MOAMPNGJYn+9c1r8rbfZI7XKtGJjGj2NSnmxk9e8P3WLQcH4cJU8fu7GI9QYykLPSJgAuW3HxEGvUsl5z6aQyj3FoLxhCnej4vYC3uAc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=LeocIx4+; arc=fail smtp.client-ip=52.101.66.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="LeocIx4+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NYJfBs6JzFSlf4wTHoRW8A7QTs7k6MtVZaEpvqtAi5DJachZdFOMvRcFOKjStdg2BeT1I+uXTOXI6kHSxUXZkmWaqEKx68LXhvFweGj1f7yUosQonuZYlgXfV0InJpc2fMbZI4NzuPkUg5q7T9hyLo1SD7aV26KKCYZfkLUeWUtS+Ukyax9paG66KswOW1YDaQasexkZRLbtoUa2K76Py5ci1ZxOKN3+a02s3PJtcXS+RD2VXfUIffGqwWfYvJbdwzGT3EYxWy+/2ZDtD7u5BhKuJMvnJyEP+nY/yQxC94w3V6HCjMuxyrO3Cd3dBww6dl2JcRPUzkrA9f7Ee2HmXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=aH20jbNOmN07YNyZ4sxTXgGz26CzhSHDXBRGbZ9/rkM=; b=FbSJ96qo9O51NU9mAG+q7aTasoF96fbBFeX9kSGG0AG7ArWQL4zQhg55xirx6XWMUQiN2c2MyRxRFSsNXLu85HFqNcJHAzAG2XQ8EKV3QUcEb8pJKo8IHMNjHEMClxjaeYlbveQZXeIUhCOPxdpdqls/ekXRAFsKfvT7Ena4xWzONeFh55NnfQALQnXFyoKxLAQjLRevLp1XCWEY/lsEBJ6DLYmU27qtNyBQX/bJFdGaaZvsGHTagKyKHfzUPHNQyghmfOg2tHtlpTcP4iHUq/daNLG3kFTuNfdSLIH2UWnKSqe9ALQVRXMz8tz2h7axSSRfrA8jsyCtFTC6gZ4g7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aH20jbNOmN07YNyZ4sxTXgGz26CzhSHDXBRGbZ9/rkM=; b=LeocIx4+QKUxebSM+0lCz43wswA5gVMLwGJv1Pht7GPFjdQUHFY1q05+OS+xfO8X0Y0Z+45I7xNJyArpap/TtXoknbCzCI1vlmKt36F5KVGvJnWjJ5bUsLM4Af0Il5BZ5j7jWFCKyZlGl24Wr0xi+3c+G58kVdIb6lWPn2tbWg8ZkW7NpKjHq0BgYzUJ+ou4u3AFZDUdX00NE3+1/LBKSRkqChvQE+Z+nFfgIHF24vPPGzNyH52wQ1kJog/ZtgcRqevye2MifEuWN7qNPd1dvSAe1QysiaLYbyM430AmNwNGtluWMX9DgmrNCAqr5dX+ECCnBSMwoJqaqYrizKBBVA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by PAXPR04MB9005.eurprd04.prod.outlook.com (2603:10a6:102:210::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Thu, 18 Jul 2024 08:45:29 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 08:45:29 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, idryomov@gmail.com, xiubli@redhat.com, Hannes Reinecke Subject: [PATCH v5 2/3] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Thu, 18 Jul 2024 11:45:13 +0300 Message-ID: <20240718084515.3833733-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240718084515.3833733-1-ofir.gal@volumez.com> References: <20240718084515.3833733-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0030.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::16) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|PAXPR04MB9005:EE_ X-MS-Office365-Filtering-Correlation-Id: 073a5c02-4481-4819-e588-08dca705f9ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 7R1QZaPCI5D35DcNgC8G1MkD1TtuGpisGZOlCuLXlPh2TM5XIMgXjdYn6ug8h0ugRtW0UfCiw+zKRIefdKTpezmhuwJ/K/OR+HMLR+0vCS2mk+lzm49QwEIet2Pn2F2u4tVAL2IY5u2/A0I+mqF4GwfXCZUXc96QFHJaq13RqbjhO1OyFTdIvHTRbiKS53utsiCTbtFuYEo7xInoSA3jTesRPl0sRuNZ4c/ddfkjGh2xuaSw6fS0rI4pstXoMBKq/I45CSSE4BfCXcHxcm4qS4QCBYsqgsIAF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Im23FAGwj6bMK0dr7n6fLidN1www++Dg1GswmqIpiP156e+jvhnvfmsS42QCmg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8344.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lcR3zV6GJ+tA2JRXKrDlvEWqvN3OII4IrULdNoPH7PXs7VZlYgQ0rY4Un8RoP+Ju4k7eEoz3A6b78BRvJ1/LorPBSHE5BSf5N0MH33MTjnWtmBdEk+4yrkfmcS/tFiGrBXrz5yztWyaMscPwqZ3lOll8jxCblgfXhiw5BMJFelqIOVRWhZyFU+uCN9GbY9FJWFV0cAjmhOUUtgjv2IerHmA90tbOwkfC1cQRGhM26OmoNxq77JHIRQTKjCSMZexuE7PPpx3eUEg3oAVC7WTUCnAjKjfL10y7jM0FT9ZqjKsrhzlb79bXwnGdZn5aVH2El3V7s44obq+KOOwP2QCWPvOoWKYSOMZJd3Ps/BBJ3lXZFi4nqqNjcVl67h5N9xXwx2st/qJ2NytFGV03qTKL9LUVIYRaXI+SXr+R3TW5e9oVetBUlcn2tHDJ9Ux5r1ChxBhHqeydC+Y1L252aSb2uGv4L5rSDjOey+K6eZt6psiZ7yf+LCKazaAnALnxjy3gdeLNtWfJ++D2nvT9ZnE0AN5FecwZAAJY+Dw5WLpMepqeF+/ixL0yzCz0Z3SDPwz2PPSEpZPpN3P1GwYM4/T0c08SuoQTnh84qJ+3FKHHk5DOyMBHPPI4vhy2g+GMPhmBpB8olT+7zV1k2crJfebo5CHt0M666m6xqx3nRJ57vN2pY22LAy/P+01yBgyn9EJG28HBslDhTPIhgFxRDEuNt8TLnjgKhHQNvgctO22irZoHkKXn0n3o3cnW2pTeH47PPz2z5+6zkOAKN1noOsfWLLZ8c4pF2S0A+6tRQQK+C8rKlwLvUPA0x3sjMymyHSghwfCMOQ3eEsbCVQBNjKEEiuZwWQrxqBvjr/AU+HBWT4GH5XgetFfWqLpPZMgmVy2+43okecgkJ46AR+u0+RcxRuTYTP5a//NKiFkESHj0wT8gwJRigxfHrY8mrqqj/P/bXbF+uhpTgzVLxNcblnGpuQpYIG3gDuxUKGJrTDr70Osrnlg/QlYmc9udsWsro21KRSepKyfhSpsMiX6I4NXD9Hov1WW1Ayfr/69vwnajnpbba/GpKU8dm3xk51fzXOMCjhixJwkKEzbf/l0grRC5GiqmX3AbXlLbivBjVq8z4NDt6Btjo0jBSvb4VQCP73OHIy4+A/k5HKp8mupEkL+cs6ZzWtF+2aHBBY6h/sqSC/wM5YDYxfqykOUJ8RaikuDJxq0xuktpG1y+jIamK1DSTuvQcEVATXy5Gb6dzpMMg7A/NG5Nd4NoUH4/ZRchxmZNk2R9gDku7AYt7+xSTQa4NIvsTE+m6gX+Qt7mCdSH/oiehZHMG/4BYp5MiCw7KoQpiXhvUmn+gP/TbtDDjtS3/vSLkLrLphsZZVr/XeYi2bKohSM9ZUc3Oyw1Cc7Xcjsv7Dhed3gr0qZn8FaNoT3js/7WBFhSLWDWDda7Uz8aPeNRFlR/ijvHIhYPNMDXXzdaUURbJmC7s5Ggzt8TcTC8QjPeEpHa5xObKxiboFt7MGXGVd8dyUg2RKUNmjhCzI+H4MUoPRoIxOIrxFjx+h1NE+Uni8R/hy7cwC/h8t0jA5nU6uUzn/pCLGsGNGjT4vLI X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 073a5c02-4481-4819-e588-08dca705f9ec X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 08:45:29.1180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mpa1Y1DXjOkse/Z8KWjgdtx9iqedWpCV1ViFxR+ebxgMo4qs8oyKlyivsOnptbIR8ACLU8/x77se46ViM4c3mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9005 Currently nvme_tcp_try_send_data() use sendpage_ok() in order to disable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When nvme_tcp_try_send_data() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to disable MSG_SPLICE_PAGES solves the issue. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Ofir Gal --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 8b5e4327fe83..9f0fd14cbcb7 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req) else msg.msg_flags |= MSG_MORE; - if (!sendpage_ok(page)) + if (!sendpages_ok(page, len, offset)) msg.msg_flags &= ~MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, len, offset); From patchwork Thu Jul 18 08:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 813223 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11022116.outbound.protection.outlook.com [52.101.66.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B48213A272; Thu, 18 Jul 2024 08:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292340; cv=fail; b=oFUuE/GiSDvtL/J0dee0I8+vMDtcyJ4PIRkxECO4ecOWl+fnf3+L8noIn017eGWo7wgs7qiZyLE7rbN2zUilF/dS/gF6D9df3qee8S8qKDg3X447VNs6D1VwkOf+A106tqGxzNwZcD2IibvHSFPPZysiSckxhUo29KbOoxcY7F4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721292340; c=relaxed/simple; bh=hrXyDaUZD5O+KIuY6QI0GBnrWAENZW6x0xDSGwfPjoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=UFRSHCm71qlRYAKfV8T5hd0AzdkMjEbN48QCY/mo1srVva2qi0e6rM4/vP5/PgQQXgShV5VoW4mDKwc8bI5gq2w8/9IQIIkS9Un1zoKn+G33vwh8bucp+gGpWj5whrPWOpWejGXMOkpZAPQvIasK92g6KuSyks7I11+/OANK9Jg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=ohcher/F; arc=fail smtp.client-ip=52.101.66.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="ohcher/F" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v4H7fT67DxCXxrOPufiCsKD9IK80r5P6wzyQCBDekDbh22xQGbLQx8kUmkySOsj8fHRX1Ur2qxIhVdvB4z4Jj0eGAAXddvd/0SBtc9MPvUd6mFFAcneV6RATrmKCnXbFQmH9fc9jsfBE/lh9vAcTmmMFX1mX/w6jCov7rV4aXU/+IbK49NFFHYYaRbfJySMkUkD93G8aP1GMgH63H0p8aFFe+Jrwz1rpYXEwn1+1qlux8UJ54RUqdEsWLevy8Vq2YrgOSIJPBWyPCxJzvUVCQ8eD0caxWX/rx232kr+qNFpxy+4Jr5fIwbVeHB/GED63ecyZ5G6UvhB7p5gE3J1NQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=aknUEp3Kc+4TagcW1u07b7OqllANt+jRXScD+Suu3ezJyZD+NBvhS5gtVHeOsx7YZmXgm4Mki2a0pA7FqLF7pMNboBY3jYjOfXORyGu1aDOUdwwZXGLQwJFa9YgS/JLdfonIvtJfAki1XS/CqKhi5hCy9VAdYwoTzAm2baG/TwB6i3n0lun9SUve5D/F8RHffyns+XqJ5NjbJFKFYIgOeV7hSC99WR0ws/OJsCjUiEGlXyiN/rKDzWagfzC3H0nIk3ScS40LBFsHJqiZgA0thCE/CHNZKCn4RDLS1EkCmm+G8FPIEMxc2jUuzz44QBRt0CcssZo8I2UamxfPND4WlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=ohcher/FbxBpNSNC89whsVEqQ41UYUZPV4RxoLlfjZFHoN7XhyK/zm9xx2jllIaDMQHj/WulOq0MPl3gvy5GbCTydXaMQLHA3mvh8n8z9h8BAFa1w50g3HlHX0kjCdp6b1SFRxtlUmCXT27py9xtz/S7/eE0GhnIdb+oq28f3jq1E33uPkvRVvqczyi9NURVJbGx6O3JFuj+B7sBrUsvzUuJnqGgtKbwj4oZGdPWIzustgzMoZiLYOCKU/aTN2uDhV1PiTGaMIHW4Dy67tGpbrgDuKXRBqPpP1gitUMi3c9V78URBJcB48yAnA3VgQoEc6ZXUvJdQUXRTXZc5JZh0Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by PAXPR04MB9005.eurprd04.prod.outlook.com (2603:10a6:102:210::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Thu, 18 Jul 2024 08:45:31 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 08:45:31 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v5 3/3] drbd: use sendpages_ok() instead of sendpage_ok() Date: Thu, 18 Jul 2024 11:45:14 +0300 Message-ID: <20240718084515.3833733-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240718084515.3833733-1-ofir.gal@volumez.com> References: <20240718084515.3833733-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0030.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::16) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|PAXPR04MB9005:EE_ X-MS-Office365-Filtering-Correlation-Id: 505f93ef-ebe3-4eaf-8108-08dca705fae6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5PnUU7/yXHy6PeDtkFlrjChAWU9CGCj?= =?utf-8?q?4eyB4YhBqSgOTDSvc3/Hgps2tR1ntYpzMkZv1gBpv/ceig/5W9E4QvcrIqFI5iJI3?= =?utf-8?q?LzWqFPEyTcVGKktO5MudPKpuL+7rTM9wVMlnRJ+KcqX4qR/m3mv3Oc9Q+poZDF5hC?= =?utf-8?q?WA+vQ4b94h3OzVWccVnDigZoi+HIFDwNyQApUzzg6W6iStEGpl9MgWqOTit0UQeYu?= =?utf-8?q?n1M8/N9vMHNjq2GBmwVMazMaElrAIqpIIP5Glu/AQP+BGA5hubh1g1UqMzQ/dpBN5?= =?utf-8?q?3ZPw17CPKghQQgtLISc9iVdsaRbiil1rjZoXG8HYyfZwSgRC7/pkgShoD9BT4EPez?= =?utf-8?q?Fwi6TJJYc1d8/e1SrdsDeGteme6yQ6zMRkhAuXJ/GLZbkFFe3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NIZG?= =?utf-8?q?+GlwLajVxhvblGOFgo9Y1VlpyfZo5n9peQkAbokoPuGbDlY1FFGssV61cvbNnN8Co?= =?utf-8?q?6FN4RdMhPxdsstTuSwa2Khoki0CMv+NwnQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8344.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8FqvddZYroY5v/TIGyqyiBawmDIj?= =?utf-8?q?xSVE12tIuRuSr9G2QrBAxTjaw7dOOIX9Vneq9Qex32xbLNw+dGA025a7dthBsi9MQ?= =?utf-8?q?qLwq69Mg5aF6XUwQE8yEAbSdMbvTvdiVKZz/dYX72f/bQsag/4w8HZc3L7sXapzna?= =?utf-8?q?7+AmwFPOFsiGK0DbZ85e17vO8pZvVHzwgW+x8Or779CzL2w7Oo271apGOLGDuF6IK?= =?utf-8?q?r1lPy/z2lqRI+P0od7xQvEAE//Xlxs9b2ExehmAx+mveehGLgShFp0Mmkt3iiyQY+?= =?utf-8?q?dFdERAATtB8o0TQvWd/FOuYDEtF3Jxp1F5dgknFgxue8xlAkH2LjqCILBaec9Y1aN?= =?utf-8?q?f1uK8/cIzB9j2okOUZRh4m6sB9qMvR8kF/T201Pewf1oH20mh3TQ34rlrPTSYkVBa?= =?utf-8?q?2F5Zw8Hdfh/l3POUYISU7s5v0s+CxNUhE2/fH49bgPtya6WgQQgDWY5COp77zNVQJ?= =?utf-8?q?Eh1y2ud32FNPdiZ15HWB4aOYhWgMOWeQ58qr5Ra2W5en2BpnSinoRNnTIs+bqrgjc?= =?utf-8?q?n1ivub6Yv6vDzNCtt8RH1DNBwOCjdg3lIZvCkLZEuhMFNHWtn7PaLRA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lynslF0?= =?utf-8?q?Qbixri9DdVhm0iNaYE8yfVEi2Dcl6lJWhQqC/eYTZh3NCFMOkaosokg/1bJHE2G8Y?= =?utf-8?q?wiX8UJAeAUhA?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 505f93ef-ebe3-4eaf-8108-08dca705fae6 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 08:45:31.1108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UVl628MNfwdYuq4yOFcUkzw+oy8L65uMwqlJpXSovK7oeJEgW35OuLPFwbEh/ew2AZzwA2/uP5Tf+RgRK4priQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9005 Currently _drbd_send_page() use sendpage_ok() in order to enable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When _drbd_send_page() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to enable MSG_SPLICE_PAGES solves the issue. Acked-by: Christoph Böhmwalder Signed-off-by: Ofir Gal --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 113b441d4d36..a5dbbf6cce23 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1550,7 +1550,7 @@ static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *pa * put_page(); and would cause either a VM_BUG directly, or * __page_cache_release a page that would actually still be referenced * by someone, leading to some obscure delayed Oops somewhere else. */ - if (!drbd_disable_sendpage && sendpage_ok(page)) + if (!drbd_disable_sendpage && sendpages_ok(page, len, offset)) msg.msg_flags |= MSG_NOSIGNAL | MSG_SPLICE_PAGES; drbd_update_congested(peer_device->connection);