[Bug 257187] NFSv3 server creates symlinks that local clients can't read [ZFS]

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 14 Jul 2021 16:20:16 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257187

            Bug ID: 257187
           Summary: NFSv3 server creates symlinks that local clients can't
                    read [ZFS]
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs_at_FreeBSD.org
          Reporter: wollman_at_FreeBSD.org

Our backup vendor alerted us to this issue.  Most of our NFS clients are Ubuntu
systems, and use NFSv3.  Somehow, one of our users managed to create a bunch of
symbolic links for which lstat(2) succeeds, but readlink(2) fails with
[ENOENT].  The links work just fine on the Linux clients over NFS.

Example ktrace on the server side:

  7597 readlink CALL 
fstatat(AT_FDCWD,0x7fffffffed99,0x7fffffffe9d0,0x200<AT_SYMLINK_NOFOLLOW>)
  7597 readlink NAMI 
"/export/sanchez/results/pls/victory/scc/2021/04-ugf/symlinks/RC/ugf_cc_scc-road_central"
  7597 readlink STRU  struct stat {dev=16608010843616580276, ino=14916386,
mode=0120777, nlink=1, uid=23398, gid=21158, rdev=18446744073709551615,
atime=1619701157.648845720, mtime=1619701157.648845720,
ctime=1619701157.648845720, birthtime=1619701157.648845720, size=298,
blksize=4096, blocks=1, flags=0x800 }
  7597 readlink RET   fstatat 0
  7597 readlink CALL  readlink(0x7fffffffed99,0x7fffffffdff4,0x3ff)
  7597 readlink NAMI 
"/export/sanchez/results/pls/victory/scc/2021/04-ugf/symlinks/RC/ugf_cc_scc-road_central"
  7597 readlink RET   readlink -1 errno 2 No such file or directory

Results of Linux stat(1) utility on the client side:

$ stat
/data/sanchez/results/pls/victory/scc/2021/04-ugf/symlinks/RC/ugf_cc_scc-road_central
  File:
/data/sanchez/results/pls/victory/scc/2021/04-ugf/symlinks/RC/ugf_cc_scc-road_central
->
../../41-cc-clean/2021_04_25-01-r5326-ugf_scc-1_4_16_64cores-34cqCap-200gvtP-OoO-t_2-prio_Timestamp-issWidth_4-bfrs_16-l1KB_32-l2PerCoreKB_256-l2Latency_9-llcPerCoreKB_1024-llcLatency_12-memGBps_192-freq_3500-lnkByts_24-subnts_4-serializeHints_True-tbPolicy_Dequeue-clea.../ugf_cc_scc-road_central/
  Size: 298             Blocks: 27         IO Block: 131072 symbolic link
Device: 36h/54d Inode: 14916386    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (23398/ victory)   Gid: (21158/sanchez-grp)
Access: 2021-07-14 12:06:14.024176419 -0400
Modify: 2021-04-29 08:59:17.648845720 -0400
Change: 2021-04-29 08:59:17.648845720 -0400
 Birth: -

This seems like a bug in either the ZPL or the NFS server.  I can't even see
how local lstat() and NFSPROC_READLINK could succeed and local readlink() still
fail.

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Wed Jul 14 2021 - 16:20:16 UTC

Original text of this message