From mboxrd@z Thu Jan 1 00:00:00 1970 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 6EDCDC433FE for ; Wed, 1 Jun 2022 02:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349220AbiFAC5e (ORCPT ); Tue, 31 May 2022 22:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbiFAC5c (ORCPT ); Tue, 31 May 2022 22:57:32 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1EFFDF78 for ; Tue, 31 May 2022 19:57:29 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id e25so422932wra.11 for ; Tue, 31 May 2022 19:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=VlU6jUY7wAtm9Bs8MNKLYXFfs6AUzYRG2s9SGR//0Ic=; b=03ZIsGjfPkTEdzeYeGcdnGMo6XfL1Iv0dpubIloys/RgtbeqoZlCwIbqaHl7G28JHl PtAJhfdI98pHCxLPDqWiJ0485PIgSwsRJfl3/+T8F7dKXfnAQMiHQLDfqamJ5djC9V8L xMee+vtCsW+WxPsHVYw1kQZ0K5n3TMKQPTdR6SeGMWVddhbEWRf2Mr7/pzEd1aBJFGlm p4+rLE5Fied6Gy4sPGX3/GryftmbVmIo8ZQ/1YBV0Na+QYUeWZcU+RF7x21lhcoIa4Rp Ps5pMAi+lY5TIMj+IzOMV6en8poJEWlCGjBAjsXzZ917s7mMp+d+0zBM6QISj8lnbHmj u1gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=VlU6jUY7wAtm9Bs8MNKLYXFfs6AUzYRG2s9SGR//0Ic=; b=pV/7ZVMDx5aPS+doMcE7vSBCOoPNI44Tt9Cg8F2aRSwH7WWuE20ipa43fRlgHQh2bm wyFeqrddXCmBCxdWzczWWhsvn7Obxpx5ydLzXai0KnIvR0vntMlWxpclUKPwcycYRqHP AKK7P3mXhLQGzfWyYenFFAPOy96M4lPUQqoZtg6FN99HJ3eSwPaqcXpJauOH5DrGisZZ ibvRc6LawM3qFvwUC5NmC0fGapgyDHJTE7vowQt+7qpLe2/06SNjf5DuuTI4yFo/vo+u t/CGOcQ8X33ezCgBXd3VXUapX/tNhY6HCmRl3u9YEBmVZ8Tl8jagJewkXosxq3aw2QXU OYPA== X-Gm-Message-State: AOAM530nsMpda2NcQCgKTmMWzAjnqmGmeT14MBYi+LFypn3cXc+kSOrm ZGEQcWE0XdDi8Zr6h3LhzgR6Dfxc/vHn4B3V X-Google-Smtp-Source: ABdhPJzn9nKigvqQAfDIeTCeiZNAuFUvrrmDUpOva7qD1eS6khkx2zgQ9b64RhQq+Z/ox7BE/6Nbcg== X-Received: by 2002:adf:ef50:0:b0:20f:fc44:63e2 with SMTP id c16-20020adfef50000000b0020ffc4463e2mr27789267wrp.3.1654052248196; Tue, 31 May 2022 19:57:28 -0700 (PDT) Received: from [10.188.163.71] (cust-east-parth2-46-193-73-98.wb.wifirst.net. [46.193.73.98]) by smtp.gmail.com with ESMTPSA id i6-20020adffc06000000b0020c5253d8dasm252906wrr.38.2022.05.31.19.57.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 19:57:27 -0700 (PDT) Message-ID: <547fa5a1-b131-8ce6-1f5d-bdffb8d73462@kernel.dk> Date: Tue, 31 May 2022 20:57:26 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 0/5] io_uring: add opcodes for current working directory Content-Language: en-US To: Usama Arif , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Cc: fam.zheng@bytedance.com References: <20220531184125.2665210-1-usama.arif@bytedance.com> <7a311f7e-a404-4ebe-f90b-af9068bab2fc@bytedance.com> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/31/22 3:35 PM, Usama Arif wrote: > > > On 31/05/2022 20:22, Jens Axboe wrote: >> On 5/31/22 1:18 PM, Usama Arif wrote: >>> >>> >>> On 31/05/2022 19:58, Jens Axboe wrote: >>>> On 5/31/22 12:41 PM, Usama Arif wrote: >>>>> This provides consistency between io_uring and the respective I/O syscall >>>>> and avoids having the user of liburing specify the cwd in sqe when working >>>>> with current working directory, for e.g. the user can directly call with >>>>> IORING_OP_RENAME instead of IORING_OP_RENAMEAT and providing AT_FDCWD in >>>>> sqe->fd and sqe->len, similar to syscall interface. >>>>> >>>>> This is done for rename, unlink, mkdir, symlink and link in this >>>>> patch-series. >>>>> >>>>> The tests for these opcodes in liburing are present at >>>>> https://github.com/uarif1/liburing/tree/cwd_opcodes. If the patches are >>>>> acceptable, I am happy to create a PR in above for the tests. >>>> >>>> Can't we just provide prep helpers for them in liburing? >>>> >>> >>> We could add a io_uring_prep_unlink with IORING_OP_UNLINKAT and >>> AT_FDCWD in liburing. But i guess adding in kernel adds a more >>> consistent interface? and allows to make calls bypassing liburing >>> (although i guess people probably don't bypass liburing that much :)) >> >> I'm not really aware of much that doesn't use the library, and even >> those would most likely use the liburing man pages as that's all we >> have. The kernel API is raw. If you use that, I would expect you to know >> that you can just use AT_FDCWD! >> >>> Making the changes in both kernel and liburing provides more of a >>> standard interface in my opinion so maybe it looks better. But happy >>> to just create a PR in liburing only with prep helpers as you >>> suggested if you think that is better? >> >> I don't disagree with that, but it seems silly to waste 5 opcodes on >> something that is a strict subset of something that is already there. >> Hence my suggestion would be to just add io_uring_prep_link() etc >> helpers to make it simpler to use, without having to add 5 extra >> opcodes. >> > > Thanks, I have created a PR for it on > https://github.com/axboe/liburing/pull/588. We can review it there if > it makes sense! Sounds good, we'll move it there. -- Jens Axboe