aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2023-06-22 13:30:59 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-07-04 03:06:46 +0000
commit109230f383ac5a60a7bd4e40bbde361c28c430cf (patch)
tree9d6e72a54a44ef5f20bc722134a2a43a7aedbeaf
parenta86b5f4f063e146597ee1f851c279d772d09afe9 (diff)
downloadsrc-109230f383ac5a60a7bd4e40bbde361c28c430cf.tar.gz
src-109230f383ac5a60a7bd4e40bbde361c28c430cf.zip
fdescfs: improve linrdlnk mount option
PR: 272127 (cherry picked from commit 3bffa2262328e4ff1737516f176107f607e7bc76)
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index 85a3c12f3419..b2ae6964551e 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -204,8 +204,9 @@ loop:
fd->fd_type = ftype;
fd->fd_fd = fd_fd;
fd->fd_ix = ix;
- if (ftype == Fdesc && fmp->flags & FMNT_LINRDLNKF)
- vp->v_vflag |= VV_READLINK;
+ /* Cannot set v_type to VCHR */
+ if (ftype == Fdesc && (fmp->flags & FMNT_LINRDLNKF) != 0)
+ vp->v_type = VLNK;
error = insmntque1(vp, mp, fdesc_insmntque_dtr, NULL);
if (error != 0) {
*vpp = NULLVP;
@@ -468,7 +469,8 @@ fdesc_getattr(struct vop_getattr_args *ap)
break;
case Fdesc:
- vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK;
+ vap->va_type = (VFSTOFDESC(vp->v_mount)->flags &
+ FMNT_LINRDLNKF) == 0 ? VCHR : VLNK;
vap->va_nlink = 1;
vap->va_size = 0;
vap->va_rdev = makedev(0, vap->va_fileid);