From nobody Thu Jul 13 01:18:20 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 4R1cDr4KkRz2tnsC; Thu, 13 Jul 2023 01:18:20 +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 4R1cDr3lVSz3wZX; Thu, 13 Jul 2023 01:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689211100; 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=E1f95syRYXRrmQL8APLlCrKCXbNAOOTZYByQqheNehE=; b=E4eta8FFqtgnfyMTR3euFNvheAxCgdXZrxw3zCNIGl7akoPy0qwUl6z4AsKxh096/LNLNz 4EgZe36UwwrTq/yt9Tid2NAGYnjXRhgMgsCkXvCBi1m/oZABVDeZW5n+KOCeIulajdgkqG 9JjOuEmNirUSST6fPfro2ABrwK8JG1V25jxpgDgnpEDC9FQB3oaK7s3L3CRWrPNIQ1ZPrP ImMKisDyl6Xs5FMcfm3Btj5DrHNjIEZ937CeqrxZatwnPQc4oxH9RAbumXd+tvPDet5JQE 3PCgyYkdVVtcIqmAZdDaqrzS141ul99l+NBBTwUGxPTpNl1th9G0oNxpsGd5yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689211100; 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=E1f95syRYXRrmQL8APLlCrKCXbNAOOTZYByQqheNehE=; b=EZ6Pltjn0RHK26AETmvgAUKjj5Z3azLmuflPIWkKWjrIvRJUfsZiRmyj5kDTAvENZIV2wt 9flTax9hEZx/jy56u+67RpYMhBFfnTxyCI958nwn3thfKqSxIYEbvppL2BRxx48xNRwyXA Seffi3R7+j+orm+0fT8l9JAstgX07d29rWnfSSbnYd52mkIU3q1MBOTJkLpfBBY2PEfYbG B3AitwTssJZ9dMXgTPdYh6ba96WLSOm5+pR1B6J1lgISHPKsxBUNWqXrbkja/6ZHDltJUY AufC+Y2r8QopWX+PHEDsQHJrZOQjrDB7/BeRz5rhytvsJ7CN242J7vWqYTE0uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689211100; a=rsa-sha256; cv=none; b=h3RqtWB8FDYEr0fwXH3Xf/9LK7CWd7aBFfPzEJYe8ZdUfSBbwQZUC/amBDY1LMw4yn77/e BNLfNF3+z02Ah0h8w4oZgjr8lwD2bRxUNKQQZ3Y0SgUQ0b/PfMWj01HjoSUUChMJyu8SQO BqSZtwhxPjHpwL0mqXM+qcxw8VqlcN8ghg4FrwLLh/Ga5ngvqumyVo/8CWkxzQRcC6kwzJ G2S5VXV8Y5QtBcrmSlnyfIsbhy3AvYoBy3LZXPhO+mgN1e1JGW3ZvEf9Hax2LdNQtuQfs9 QWPoN9IReyg6xx3uoRAWHw0+BLGXG30Y8A1BhqQDbXg1ubIWFDR0EU+pizfTQg== 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 4R1cDr2jHpzX5Y; Thu, 13 Jul 2023 01:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36D1IKEw005014; Thu, 13 Jul 2023 01:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36D1IKoh005013; Thu, 13 Jul 2023 01:18:20 GMT (envelope-from git) Date: Thu, 13 Jul 2023 01:18:20 GMT Message-Id: <202307130118.36D1IKoh005013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9c3bfe2ad071 - main - Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option" 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=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7 commit 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7 Author: Konstantin Belousov AuthorDate: 2023-07-11 04:58:06 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-13 01:14:12 +0000 Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option" This reverts commits 4a402dfe0bc44770c9eac6e58a501e4805e29413 and 3bffa2262328e4ff1737516f176107f607e7bc76. The fix will be implemented in somewhat different manner. The semantic adjustment is incompatible with linuxolator expectations. Reported and reviewed by: dchagin Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40969 --- sys/fs/fdescfs/fdesc_vnops.c | 8 +++----- sys/kern/vfs_subr.c | 4 +++- sys/kern/vfs_syscalls.c | 2 +- sys/sys/vnode.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 3f6fca16c715..1c4b6d0c6cdb 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -190,9 +190,8 @@ loop: fd->fd_type = ftype; fd->fd_fd = fd_fd; fd->fd_ix = ix; - /* Cannot set v_type to VCHR */ - if (ftype == Fdesc && (fmp->flags & FMNT_LINRDLNKF) != 0) - vp->v_type = VLNK; + if (ftype == Fdesc && fmp->flags & FMNT_LINRDLNKF) + vp->v_vflag |= VV_READLINK; error = insmntque1(vp, mp); if (error != 0) { vgone(vp); @@ -458,8 +457,7 @@ fdesc_getattr(struct vop_getattr_args *ap) break; case Fdesc: - vap->va_type = (VFSTOFDESC(vp->v_mount)->flags & - FMNT_LINRDLNKF) == 0 ? VCHR : VLNK; + vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK; vap->va_nlink = 1; vap->va_size = 0; vap->va_rdev = makedev(0, vap->va_fileid); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index b7d43863a228..25efabf3acc7 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4284,9 +4284,11 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VV_MD", sizeof(buf)); if (vp->v_vflag & VV_FORCEINSMQ) strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); + if (vp->v_vflag & VV_READLINK) + strlcat(buf, "|VV_READLINK", sizeof(buf)); flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | VV_CACHEDLABEL | VV_VMSIZEVNLOCK | VV_COPYONWRITE | VV_SYSTEM | - VV_PROCDEP | VV_DELETED | VV_MD | VV_FORCEINSMQ); + VV_PROCDEP | VV_DELETED | VV_MD | VV_FORCEINSMQ | VV_READLINK); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 52145ece7120..d68af4ea4d51 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2677,7 +2677,7 @@ kern_readlink_vp(struct vnode *vp, char *buf, enum uio_seg bufseg, size_t count, if (error != 0) return (error); #endif - if (vp->v_type != VLNK) + if (vp->v_type != VLNK && (vp->v_vflag & VV_READLINK) == 0) return (EINVAL); aiov.iov_base = buf; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index e7ebc39ada1d..d8fd580facb5 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -270,7 +270,7 @@ _Static_assert(sizeof(struct vnode) <= 448, "vnode size crosses 448 bytes"); #define VV_DELETED 0x0400 /* should be removed */ #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ -#define VV_UNUSED01 0x2000 /* was: fdescfs linux vnode */ +#define VV_READLINK 0x2000 /* fdescfs linux vnode */ #define VV_UNREF 0x4000 /* vunref, do not drop lock in inactive() */ #define VV_CROSSLOCK 0x8000 /* vnode lock is shared w/ root mounted here */