Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1032503rwb; Wed, 26 Jul 2023 06:43:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlH01eTS/quk7glDfIFIZpArGt+u4ZRZ9kwYu57LRdPdRtwykBms7KXezCmq1dfe56zjpenr X-Received: by 2002:a05:6a21:6da0:b0:133:c170:6ee9 with SMTP id wl32-20020a056a216da000b00133c1706ee9mr2614030pzb.42.1690379008731; Wed, 26 Jul 2023 06:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690379008; cv=none; d=google.com; s=arc-20160816; b=lpUs2/FvbFYleEYIyjNgMXKciR6lHP0pRC5bwhU2JD5m8/Nf6ccVauUylRQT5ra0yl aT2ohdBkWFZ7p+Zh0J/2oCjbXIBbQvDo+uiWmUyza5tH7HAV725uzpXsfKNeDT0jNyHQ lQ/EjmozXGVKxfGG0vQgIs64GESVvUwqTcFanwsLbr9DeiL2FiE7ZsglRsw3nAYibd6g skbHsQy78ECf7RmpUYhks/TTByQFir50MaN+NzSj+IaCChQYJ/tNro1UsVUJoUMGIsq5 C6a+PjevZv5jJsLmJx471ulzDFfIMbGuWULjEMGx0a5y7MQbunFMtoBqbjZCvVNhLhk5 c/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lnB+SFp2ylCxm3MqZEuWU9KcinOJMBtzH2fiUCp9o4A=; fh=LQRJHb7U1HQT/l6fyPmgbFbKa6FKtYsVfzFkzZfVRB0=; b=NGJf1OB216hwhCGi9iw4sfrLzT4J3Jqvrsbpm0YbG0Glk1CC366hSHrDrJmYOIFDjO 0xH90a6RNwCgE58X+PQRCFAuW82R2eMY+8KCvpe5MjO8qGsqlL/tX7G1N1sDqtRpB3Qr BV7SReoBc8mHKcZw7x7izAY7jJwEaDnoknOCAplMbZ4cHPCEP80ADa1zTGBzWt/RIR8d KSPVDXvd0dXxQM7wDmh8s++QblnQ/Qmftv+hKFXvOMVve4jjioO+Kq7MJVQGZZC+kzGo ykXY3MmvFZRCeDqvzvZ0zKv3JyrTUel12Msoef9foo+HqEuXNk+nn5/VlfzP8pxqtDYD Gu9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hub6FWYE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r142-20020a632b94000000b00563e70c270dsi1004717pgr.463.2023.07.26.06.43.10; Wed, 26 Jul 2023 06:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hub6FWYE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbjGZNWN (ORCPT + 99 others); Wed, 26 Jul 2023 09:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233885AbjGZNWL (ORCPT ); Wed, 26 Jul 2023 09:22:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494BA1FEC; Wed, 26 Jul 2023 06:22:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DC196613CA; Wed, 26 Jul 2023 13:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D1C7C433CB; Wed, 26 Jul 2023 13:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690377729; bh=KWTeyV7DSPb2JSt6yu397zgUB2KJ1PVPqwI+zIQkUUU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hub6FWYEiLv7RETY8FZB+4ovR289Ky7YEJFew1gNoTwUJx5d0fvY/MaUcswq9cN55 eOLKkWA7zCbBr4qm18cto0btKTqHrXlOv4VtOZKpRWyitSLHwJeFLmkbUbGbvGXcmX U2Lyci2qJsVnB9FYCPuJVvOHqelPiQ0OxTyM6IrQ2JiPIXdyA8glXCvFIEZiJI8hqd z6Kkvn5IzqN7TCGoUmQUe/xfTS1ErAE1cy+njytugbaqPp+v1XOCiUUQjAZ1IQPs1i F1MpOw056Uu94n9EOORfYx7WjPG/7iVX5nk9rT83vbpQ3BzEjsIxwOy6TRKvO2CN8J 3f+2mcb31nQVg== Date: Wed, 26 Jul 2023 15:22:03 +0200 From: Christian Brauner To: Hao Xu Cc: io-uring@vger.kernel.org, Jens Axboe , Dominique Martinet , Pavel Begunkov , Alexander Viro , Stefan Roesch , Clay Harris , Dave Chinner , "Darrick J . Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, Wanpeng Li Subject: Re: [RFC 0/7] io_uring lseek Message-ID: <20230726-reinreden-packten-e7ab9aff296a@brauner> References: <20230726102603.155522-1-hao.xu@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230726102603.155522-1-hao.xu@linux.dev> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-ext4@vger.kernel.org On Wed, Jul 26, 2023 at 06:25:56PM +0800, Hao Xu wrote: > From: Hao Xu > > This series adds lseek for io_uring, the motivation to import this > syscall is in previous io_uring getdents patchset, we lack a way to > rewind the file cursor when it goes to the end of file. Another reason > is lseek is a common syscall, it's good for coding consistency when > users use io_uring as their main loop. While I understand this it is a time consuming review to make sure things work correctly. So before we get this thing going we better get getdents correct first. > > Patch 1 is code clean for iomap > Patch 2 adds IOMAP_NOWAIT logic for iomap lseek > Patch 3 adds a nowait parameter to for IOMAP_NOWAIT control > Patch 4 adds llseek_nowait() for file_operations so that specific > filesystem can implement it for nowait lseek > Patch 5 adds llseek_nowait() implementation for xfs > Patch 6 adds a new vfs wrapper for io_uring use > Patch 7 is the main io_uring lseek implementation > > Note, this series depends on the previous io_uring getdents series. > > This is marked RFC since there is (at least) an issue to be discussed: > The work in this series is mainly to reslove a problem that the current > llseek() in struct file_operations doesn't have a place to deliver > nowait info, and adding an argument to it results in update for llseek > implementation of all filesystems (35 functions), so here I introduce > a new llseek_nowait() as a workaround. My intuition would be to update all filesystems. Adding new inode operations always starts as a temporary thing and then we live with two different methods for the next years or possibly forever. But it'd be good to hear what others think.