Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4431258pxb; Mon, 21 Feb 2022 21:24:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+ifvVFdFLNGLIDGlN4AFN/7aUY8ZhMkoi6dnK6Vvm3WAIt7RkDnBpB2PAcbO6XEZrxsBY X-Received: by 2002:a05:6a00:26c1:b0:4e1:3135:97a9 with SMTP id p1-20020a056a0026c100b004e1313597a9mr23330573pfw.13.1645507469816; Mon, 21 Feb 2022 21:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507469; cv=none; d=google.com; s=arc-20160816; b=AYYoQB8fi71qowJKRni8e7wj4rDYkdsQyYCQqY8LvdSX7H7tDasLmfqQshp2VLlyxr 2+hWbsGrHKSNLhpb3IXseoNbUWrRhaxMJQGWPNXqMKyev0X5Sjkzc3etKZx88i2TZSmq ehqSzEeoNHR/8pDuY0hCAeEMmHixY6ZtnQYl0hlfGDOX6x7sWBm/BgW1VzhJzDFgPf3L lzWaXCKFiSJ+boPtoCimM3v4GzpAToOd/dAjNp5wP3wIYKxoOb4Vr2sxsAEfJ9DiUDBR ELR0t503ANHdws+bcDIdUCGyfLl3tCPZqR0+SOk9SntD8knQyn5PLYoKtKu+hC0cTSak zg7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7+Oc8xa6Bsvgnpy9ryRsNs518qoE8ZxNm654+iprwTg=; b=IzEvv2mHH7eJiIvurpGhhUbQPUo7HckM76AbgsW7Pu+soa8bXE945TrpwuKon9jzan YmM7hrRMFeRLth9XXKSZ6FmHfLfaQxpzcDYr2mDdBrS6fGf1OC4GV5XJ8HBu34DYGlA9 Qfui+WC0ffN+APvg//VJEk4SFoooMd19MzN9yYL+xyzQ8SG1PH6rOb3FZLfBparbJgKJ v/1EyYwKFk+UvS3sbnEmA40gQ0c7FNPEwKySQy94ARRlyl+3ESyo9UMcYvhYyAbxzdzy W163PscowAVnFC8VxKf0Opjl9DLO/PER/HfeMpDXFdtxgJ6pRPj4M+tJG+wd02C8njkA MAWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=MCVSv+kh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id gw1-20020a17090b0a4100b001b9d3e51dbesi1169480pjb.16.2022.02.21.21.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:24:29 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=MCVSv+kh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9ABD1029C2; Mon, 21 Feb 2022 20:55:04 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377505AbiBUORl (ORCPT + 99 others); Mon, 21 Feb 2022 09:17:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377495AbiBUORk (ORCPT ); Mon, 21 Feb 2022 09:17:40 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10DD193ED for ; Mon, 21 Feb 2022 06:17:17 -0800 (PST) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21L4KJ8b014222 for ; Mon, 21 Feb 2022 06:17:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=7+Oc8xa6Bsvgnpy9ryRsNs518qoE8ZxNm654+iprwTg=; b=MCVSv+khawygWSut5xj3DQBvdpVzGsOHMwE0JjZjiagRtYSNHusjCb+zNirvXZwKmAap oQSQR6XjEM8ewWYUi/9P/A4BqCYsX958PrpyEBe+CSST6h1yvDsJJSja4xwEyTyBDftH LUVZ0xiSiqBHmwtoEm9ooCoF+Iw4i2pDMgw= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3eaxhx98da-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 21 Feb 2022 06:17:17 -0800 Received: from twshared7500.02.ash7.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 21 Feb 2022 06:17:15 -0800 Received: by devbig039.lla1.facebook.com (Postfix, from userid 572232) id 6BA3E46F08E3; Mon, 21 Feb 2022 06:17:12 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov , CC: , , Dylan Yudaken Subject: [PATCH v2 0/4] io_uring: consistent behaviour with linked read/write Date: Mon, 21 Feb 2022 06:16:45 -0800 Message-ID: <20220221141649.624233-1-dylany@fb.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: 1Ib1rS-kbeKL34X8YTkTbMUHF07yJKfA X-Proofpoint-GUID: 1Ib1rS-kbeKL34X8YTkTbMUHF07yJKfA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-21_07,2022-02-21_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=fb_outbound_notspam policy=fb_outbound score=0 mlxscore=0 clxscore=1011 phishscore=0 priorityscore=1501 adultscore=0 mlxlogscore=742 suspectscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202210086 X-FB-Internal: deliver X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently submitting multiple read/write for one file with offset =3D -1 = will not behave as if calling read(2)/write(2) multiple times. The offset may = be pinned to the same value for each submission (for example if they are punted to the async worker) and so each read/write will have the same offset. This patch series fixes this. Patch 1,3 cleans up the code a bit Patch 2 grabs the file position at execution time, rather than when the j= ob is queued to be run which fixes inconsistincies when jobs are run asynchr= onously. Patch 4 increments the file's f_pos when reading it, which fixes inconsistincies with concurrent runs.=20 A test for this will be submitted to liburing separately. v2: * added patch 4 which fixes cases where IOSQE_IO_LINK is not set Dylan Yudaken (4): io_uring: remove duplicated calls to io_kiocb_ppos io_uring: update kiocb->ki_pos at execution time io_uring: do not recalculate ppos unnecessarily io_uring: pre-increment f_pos on rw fs/io_uring.c | 103 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 88 insertions(+), 15 deletions(-) base-commit: 754e0b0e35608ed5206d6a67a791563c631cec07 --=20 2.30.2