The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=08a1dd9ad11090df27c4271d7205fb05b8ff62a9

commit 08a1dd9ad11090df27c4271d7205fb05b8ff62a9
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2023-07-11 04:58:06 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2023-07-20 12:20:09 +0000

    Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount 
option"
    
    (cherry picked from commit 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7)
---
 sys/fs/fdescfs/fdesc_vnops.c | 3 +--
 sys/kern/vfs_subr.c          | 4 +++-
 sys/kern/vfs_syscalls.c      | 2 +-
 sys/sys/vnode.h              | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index b2ae6964551e..522009550986 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -469,8 +469,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 dd742277a98f..21061984bcc3 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -4263,9 +4263,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_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ);
+           VV_PROCDEP | VV_NOKNOTE | 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 b7cdac8540da..7f7836450811 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2660,7 +2660,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 e79bd1c9ddba..fdf3b8f0e5fd 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -271,7 +271,7 @@ struct xvnode {
 #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_UNLINKED     0x8000  /* unlinked but stil open directory */
 

Reply via email to