From nobody Tue Jun 27 22:34:59 2023 X-Original-To: dev-commits-src-main@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 4QrKKJ1wDjz4jqYS; Tue, 27 Jun 2023 22:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QrKKJ11DPz3x2H; Tue, 27 Jun 2023 22:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687905300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8P1+ZU9DoqfbJKjeXU/8ZSNqiv7iLEGKoWC27PQEtwY=; b=mqxZsczdvGYk9XGZeSC8GztGxkg1HfT5On/CuWVpocoBTcaWr4uCQ2SgEt4h15GdQqHK6V pDp3UMim4Cws2btSvo3Z1NgumpX63oIivztxuWYWSdRRTLr7bO76VoQBOFSwye62vB9njG yFJaBgfGvZUk0j67uqibpP9EqLPSRcyBH75XfJH/19OkFaIRNVkquXw9bMAEyRN1tjDQGN GRjl0UnKgOK/EFc7bQOIjYhrt1BWIuXWk7u4pOAuF+BRdDCJKVJTLsMSAxi2hsoVWqVOew ypz4h3Ptx+h2GZbl98x6oAagre0vmRKg8xBVaD3wp24LYHWX5t48ciOWIgPqhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687905300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8P1+ZU9DoqfbJKjeXU/8ZSNqiv7iLEGKoWC27PQEtwY=; b=JBgTLvGcbyd13PF5zj1pehmZLZWofDB4jljcvF58dsP+ALaldUj3TWumb06yjbr37nFne8 V1y7kkBCYuc5xicC7VMFZb6PXjIFRT7fqdlzMoHOFcTpRchJE1cE9nSVTuuNgyfQ5cdKi1 c9OwuoYWhmJ5GwDoTZMkSGqqe0KneRV82jF1gbhHi0KAQqpULFynL2LmWxO+TqbQxn2cxn LdFGIkx3ZiWGHmjFojF2Fua8PSL9n04ErSMRhss4U2QqRf8uRgwncDkcYDx3fWJOgob1Yr MkDaFXR944daSioqoPm1JOV/HglxiM6SbPLr5MN/Z4gWz1XGisFZpCH9gcsWpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687905300; a=rsa-sha256; cv=none; b=wA6p4ENeFpKMPy7UT9jcbIG/1WiQ5THSVbJaWJo/NyHIw7nzL/z7KYHeSEdJ8r0M5gDDax 8EvB76qb387mE473tIm9/ezHOxED8JEq/3V5jiJEhVzJpYsy+w6oihK6HWbhOmVDI+zLIb CYkBm9UxYwBPFCsykiJVQsi6MWp/77pApMpd5Vv57NJBvdp1JiORdZn0Log2Vc4LsaLC4i C1mIYmx1FAxXBwoj7sqq26SrbT2GUoUiPtFJt1eCJNMWh37qep5C7WlbYSqfybYmkl+UAZ KXcawFSTE1lH96PZJ2Ty9GXXjLXsm32haSmnL9DEzCRfOE8LyH2bCRxU+rRzCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QrKKH62Cpz18rL; Tue, 27 Jun 2023 22:34:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35RMYxlY047297; Tue, 27 Jun 2023 22:34:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35RMYxAt047296; Tue, 27 Jun 2023 22:34:59 GMT (envelope-from git) Date: Tue, 27 Jun 2023 22:34:59 GMT Message-Id: <202306272234.35RMYxAt047296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7b5a1c39f1e6 - main - vfs: bring vfs_lookup() description comment up to date List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b5a1c39f1e65737b8c29de46aecb88f90c7c33d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b5a1c39f1e65737b8c29de46aecb88f90c7c33d commit 7b5a1c39f1e65737b8c29de46aecb88f90c7c33d Author: Igor Ostapenko AuthorDate: 2023-06-27 22:31:50 +0000 Commit: Warner Losh CommitDate: 2023-06-27 22:34:02 +0000 vfs: bring vfs_lookup() description comment up to date Signed-off-by: Igor Ostapenko Reviewed by: imp, mhorne Pull Request: https://github.com/freebsd/freebsd-src/pull/737 --- sys/kern/vfs_lookup.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 52fc3ecbd01d..73df48e96efe 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -879,27 +879,27 @@ vfs_lookup_failifexists(struct nameidata *ndp) * * The pathname is pointed to by cn_nameptr and is of length ni_pathlen. * The starting directory is taken from ni_startdir. The pathname is - * descended until done, or a symbolic link is encountered. The variable - * ni_more is clear if the path is completed; it is set to one if a + * descended until done, or a symbolic link is encountered. The cn_flags + * has ISLASTCN or'ed if the path is completed or ISSYMLINK or'ed if a * symbolic link needing interpretation is encountered. * - * The flag argument is LOOKUP, CREATE, RENAME, or DELETE depending on + * The cn_nameiop is LOOKUP, CREATE, RENAME, or DELETE depending on * whether the name is to be looked up, created, renamed, or deleted. * When CREATE, RENAME, or DELETE is specified, information usable in * creating, renaming, or deleting a directory entry may be calculated. - * If flag has LOCKPARENT or'ed into it, the parent directory is returned - * locked. If flag has WANTPARENT or'ed into it, the parent directory is + * If cn_flags has LOCKPARENT or'ed into it, the parent directory is returned + * locked. If it has WANTPARENT or'ed into it, the parent directory is * returned unlocked. Otherwise the parent directory is not returned. If - * the target of the pathname exists and LOCKLEAF is or'ed into the flag + * the target of the pathname exists and LOCKLEAF is or'ed into the cn_flags * the target is returned locked, otherwise it is returned unlocked. - * When creating or renaming and LOCKPARENT is specified, the target may not - * be ".". When deleting and LOCKPARENT is specified, the target may be ".". * * Overall outline of lookup: * + * handle degenerate case where name is null string + * * dirloop: * identify next component of name at ndp->ni_cnd.cn_nameptr - * handle degenerate case where name is null string + * handle .. special cases related to capabilities, chroot, jail * if .. and crossing mount points and on mounted filesys, find parent * call VOP_LOOKUP routine for next component name * directory vnode returned in ni_dvp, unlocked unless LOCKPARENT set @@ -907,6 +907,7 @@ vfs_lookup_failifexists(struct nameidata *ndp) * if result vnode is mounted on and crossing mount points, * find mounted on vnode * if more components of name, do next level at dirloop + * if VOP_LOOKUP returns ERELOOKUP, repeat the same level at dirloop * return the answer in ni_vp, locked if LOCKLEAF set * if LOCKPARENT set, return locked parent in ni_dvp * if WANTPARENT set, return unlocked parent in ni_dvp