From nobody Tue May 02 19:04:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9qJV6VhBz49J2S; Tue, 2 May 2023 19:04:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9qJV3vRxz42LM; Tue, 2 May 2023 19:04:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7515631b965so1040020185a.0; Tue, 02 May 2023 12:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683054281; x=1685646281; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=BsHH1zJ7xeW03Z6DhPQB3WLk+FbPP2Hzs9pNgV+oXvE=; b=UMkeIKpKLIEBA+lCVBafydlq1m7v8oxrhzVkQtjywDTsV0lV90rIPIbfago6jOlAX2 L03r6vCxnCElpt4qUvRpCOEWPIyKFQBvxHN+Hclu17t8xHMvqdEjiaBRuweFggL8FUoE Jr2QcQUgigzHKoG/zJa0iuA84N/wIRQBOVI6k6iZyq166N4nJoQWY9A/QOiANd3PIPLN ByoVW3ws1hyxatcp7zaQc6ljzBqPmUhu6RoNtMng7IxY74ABNOk0UdtxAzVmdG9vJ1+f KEKUJ5/K7p5uUR5URSdBvkdVA3mbgtaIZAbmZh+jK3Kpz6V8Kyle1l7eytyUz7wNBeYj RjvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683054281; x=1685646281; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BsHH1zJ7xeW03Z6DhPQB3WLk+FbPP2Hzs9pNgV+oXvE=; b=I8LiQF5lXZV4pBd9CC8BkddfTUJQ9erRuEsx0AIYJhwS7i00DnA08kxkX15+UtYxil zmfNjTGYJGYzfp6RzibPmxwe6Q+Hy9mA4JUis18dTQ7p6XbXEJBJaMyjwFvf/OTTu5qc bv4POBtcX91oK/fG+fkQmogkxbPPkNVqEEDXg6tfzOc6cSCTbRES2cFLVF/zSymo51oM gSD4HonBIGV0JxTCkKKT2+fBdjr+8GjWO8O6MjrBPIVGhpyrbzbZZue4nEyz/ccMJUC+ M0dHqS8TK7FUECjMDXOGUq+LjcJ8OvfIlmtl2/r1EtDj0ypj2P0pgbUMKIsSPWALeC4o cBng== X-Gm-Message-State: AC+VfDznlqUNxrRy2fDdSdx6/v2lY1xdLmInvwe/n3QAzGyytzQ09LVX 6m9nYflQsxajyinQqjosUrpXuq4RcCg= X-Google-Smtp-Source: ACHHUZ6N7o8QEmjeoAuguI/Lg8f4HgXHZ/LleXw3c2JmxAYqlD0b+0AakcooPixvFz6d0UU0SXp8fA== X-Received: by 2002:ad4:5f4b:0:b0:61b:65f4:2a15 with SMTP id p11-20020ad45f4b000000b0061b65f42a15mr5455286qvg.12.1683054281054; Tue, 02 May 2023 12:04:41 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id or16-20020a05620a619000b0074abe1e1457sm9889640qkn.76.2023.05.02.12.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 12:04:40 -0700 (PDT) Date: Tue, 2 May 2023 15:04:37 -0400 From: Mark Johnston To: Dmitry Chagin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a1d71cebc05c - main - fstatat(2): restore AT_EMPTY_PATH handling Message-ID: References: <202305021512.342FCpbN056202@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Q9qJV3vRxz42LM X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, May 02, 2023 at 08:00:01PM +0300, Dmitry Chagin wrote: > On Tue, May 02, 2023 at 03:12:51PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=a1d71cebc05ccfeedf95f2db3e94b17270167888 > > > > commit a1d71cebc05ccfeedf95f2db3e94b17270167888 > > Author: Konstantin Belousov > > AuthorDate: 2023-05-02 15:11:39 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2023-05-02 15:11:39 +0000 > > > > fstatat(2): restore AT_EMPTY_PATH handling > > > > Fixes: cb858340dcbf214cc4c4d78dbb741620d7b3a252 > > Reported by: markj > > Sponsored by: The FreeBSD Foundation > > --- > > sys/kern/vfs_syscalls.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c > > index 5c0a291e3b0b..d68af4ea4d51 100644 > > --- a/sys/kern/vfs_syscalls.c > > +++ b/sys/kern/vfs_syscalls.c > > @@ -2438,8 +2438,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, > > AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF | > > AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights); > > > > - if ((error = namei(&nd)) != 0) > > + if ((error = namei(&nd)) != 0) { > > + if (error == ENOTDIR && > > + (nd.ni_resflags & NIRES_EMPTYPATH) != 0) > > + error = kern_fstat(td, fd, sbp); > > return (error); > > + } > > cache_fplookup_dirfd() doesnt set the NIRES_EMPTYPATH flag It doesn't, but for an AT_EMPTY_PATH lookup it aborts the lookup and returns ENOTDIR to namei(), which sets NIRES_EMPTYPATH before passing the error up. > > error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED); > > NDFREE_PNBUF(&nd); > > vput(nd.ni_vp); >