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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB98EC2D0C2 for ; Sat, 4 Jan 2020 17:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8777B22B48 for ; Sat, 4 Jan 2020 17:41:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="T4DFtMQl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgADRlX (ORCPT ); Sat, 4 Jan 2020 12:41:23 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:35281 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgADRlX (ORCPT ); Sat, 4 Jan 2020 12:41:23 -0500 Received: by mail-pj1-f52.google.com with SMTP id s7so6003299pjc.0 for ; Sat, 04 Jan 2020 09:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xUK668tkpk/kcB9h3Av/zeNHCOyLiiQQcvmr53DDBqw=; b=T4DFtMQlQWmBeNvxnUL9IyV2qUlFcq60Qj/UI6xatzvqee0XVoDaq1agG+oWMVnFBm 2IIXzPeePJvG0/peyn/sCQntye+vyV22rUDz/DQcuR1aRWVAo7tEMqZQuyWOdkcoRutw 6j+wwoSodTO4WNz8slIgjy6MHKuw0rk2+rEgiVBVct6gImHyPJBCgt7E928URHMm/A2Y 9+wOrDAtbrgfRbN7ZCJueMf55tTGG2cWMdapJW5SFeCXsI/FreopHG0UyIdKmBgry3hT s3Aq1kaLLzJ+/reTJPPKsJI4e9YCamHcxt42PlrJ+pvHhA5pT4RIEeKy6hD8NfRoAYLG rnvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xUK668tkpk/kcB9h3Av/zeNHCOyLiiQQcvmr53DDBqw=; b=jdR25nQVhMpiGP0ajhTggv2aA5+UIqPf63EpHxk9KIxy7Wk6j6lNi71VzWMsOwiDv6 Snd7EZe3dN4XJK8fKHfkcLIBPS5MIK2/KExyk4fB6Z40hRSOHyxAOUP7Tb0dngXLsCqN NGkBKpqqmkYMr2/iWXsCLyea8dUD8E5yfUSevQOpl4kD4Bbb5p8U4pskS2Lw443X4Xng 9V5TeiISPe4pMlBSit1QtNSgeChtNiOUR5gksVdTa3RnvVWZ73B6iWFgpxgPTdvMC9vs VGAa4RZcCLFxR448McAeqprOsIAk8wPRpe9iG1nAVBKqp2LHaJ3wEPcR6+qBRyeCVlkB sPAA== X-Gm-Message-State: APjAAAXltqJQIyR66jSZAqmIw9h5D338alDc6de0euIvV+jIKmuiB4uU IgFMYtN2g3KdTuOwP6tLuWsMIXkd/HC41Q== X-Google-Smtp-Source: APXvYqxyH+sWBnv0yaz1JIc8ehbb3QOHqIdCe5D9Fo/F9id7MnYIbOUylmmW4R2gpjwfVSeoHRHIig== X-Received: by 2002:a17:90b:3cc:: with SMTP id go12mr33567861pjb.89.1578159682090; Sat, 04 Jan 2020 09:41:22 -0800 (PST) Received: from ?IPv6:2605:e000:100e:8c61:c432:634e:2cbb:b7c? ([2605:e000:100e:8c61:c432:634e:2cbb:b7c]) by smtp.gmail.com with ESMTPSA id j5sm56401642pfn.180.2020.01.04.09.41.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2020 09:41:21 -0800 (PST) Subject: Re: SQPOLL behaviour with openat To: William Dauchy Cc: io-uring@vger.kernel.org References: <20200104162211.9008-1-wdauchy@gmail.com> From: Jens Axboe Message-ID: <587a53c3-5a7e-e8fa-d7d4-9bc33e0ec8ce@kernel.dk> Date: Sat, 4 Jan 2020 10:41:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 1/4/20 9:41 AM, William Dauchy wrote: > Hello Jens, > > Thank you for the quick answer. > > On Sat, Jan 4, 2020 at 5:28 PM Jens Axboe wrote: >> sqpoll requires the use of fixed files for any sqe, at least for now. >> That's why it returns -EBADF if the request doesn't have fixed files >> specified. > > I indeed forgot sqe->flags |= IOSQE_FIXED_FILE; in my modified test. > >> So it cannot be used with opcodes that create (or close) file >> descriptors either. > > ok, I thought `dirfd` could have been the index of my registered fd > for `openat` call. It was not very clear to me this was not possible > to use fixed files for those opcodes. I should probably clarify that in the man pages! I'll get that done. But yes, that it is how it _should_ work for registered files. I haven't spent too much time on sqpoll lately, but there's really no reason why it cannot do everything that the regular path can. Just need to ensure the proper inheritance is done, it's a kernel thread just like the async workers. -- Jens Axboe