From 9e706ec984501b5157191761c66081da6f269ce0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 19 Nov 2024 15:45:09 +0000 Subject: [PATCH] serve nfs: fix missing inode numbers which was messing up ls -laR In 6ba3e2485399a918 serve nfs: fix incorrect user id and group id exported to NFS #7973 We updated the stat function to output uid and gid. However this set the inode numbers of everything to -1. This causes a problem with doing `ls -laR` giving "not listing already-listed directory" as it uses inode numbers to see if it has listed a directory or not. This patch reads the inode number from the vfs.Node and sets it in the Stat output. --- cmd/serve/nfs/filesystem.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/serve/nfs/filesystem.go b/cmd/serve/nfs/filesystem.go index db918d895..5bb7e8375 100644 --- a/cmd/serve/nfs/filesystem.go +++ b/cmd/serve/nfs/filesystem.go @@ -3,7 +3,6 @@ package nfs import ( - "math" "os" "path" "strings" @@ -37,7 +36,7 @@ func setSys(fi os.FileInfo) { Nlink: 1, UID: vfs.Opt.UID, GID: vfs.Opt.GID, - Fileid: math.MaxUint64, // without this mounting doesn't work on Linux + Fileid: node.Inode(), // without this mounting doesn't work on Linux } node.SetSys(&stat) }