From patchwork Wed Jun 8 17:17:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 12874402 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF9FDC43334 for ; Wed, 8 Jun 2022 17:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231944AbiFHRYf (ORCPT ); Wed, 8 Jun 2022 13:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbiFHRYR (ORCPT ); Wed, 8 Jun 2022 13:24:17 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABCEF5A16B for ; Wed, 8 Jun 2022 10:18:06 -0700 (PDT) Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 258H6JYO008864 for ; Wed, 8 Jun 2022 10:18:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=Ql6iLhooUD0Dcm1lXif58GidTsVYMKW+1JrVOBVCBsc=; b=jGKOz5XyLaAscJ7ZtRK4zatK4Ndha6AMDoPI8i6GZzjMzknzbwjlHhtO1tJJT7ijalm4 Les7221p+yUVyQhjzddJAET37InAiy0TmDbQGOHsmRy0sY+0yOP9OHepv13+JmLxKjFC hMAbgG64xcGXMqZzGUrClyeG/Tu/eDskH0I= Received: from maileast.thefacebook.com ([163.114.130.16]) by m0089730.ppops.net (PPS) with ESMTPS id 3gjyva0311-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 08 Jun 2022 10:18:05 -0700 Received: from twshared17349.03.ash7.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 8 Jun 2022 10:18:04 -0700 Received: by devvm225.atn0.facebook.com (Postfix, from userid 425415) id 9B2E5103BFB5C; Wed, 8 Jun 2022 10:17:43 -0700 (PDT) From: Stefan Roesch To: , , , , CC: , , , , Subject: [PATCH v8 06/14] iomap: Return -EAGAIN from iomap_write_iter() Date: Wed, 8 Jun 2022 10:17:33 -0700 Message-ID: <20220608171741.3875418-7-shr@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220608171741.3875418-1-shr@fb.com> References: <20220608171741.3875418-1-shr@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: w-k7bn5vNAHzjoYZKJZ0f8Eb6PWlu8Is X-Proofpoint-ORIG-GUID: w-k7bn5vNAHzjoYZKJZ0f8Eb6PWlu8Is X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-08_05,2022-06-07_02,2022-02-23_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org If iomap_write_iter() encounters -EAGAIN, return -EAGAIN to the caller. Signed-off-by: Stefan Roesch --- fs/iomap/buffered-io.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index b06a5c24a4db..f701dcb7c26a 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -829,7 +829,13 @@ static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i) length -= status; } while (iov_iter_count(i) && length); - return written ? written : status; + if (status == -EAGAIN) { + iov_iter_revert(i, written); + return -EAGAIN; + } + if (written) + return written; + return status; } ssize_t