From d8332171e9bbe127ff5fc0fd18a7c80f6de7b909 Mon Sep 17 00:00:00 2001 From: ston3lu <152957308+ston3lu@users.noreply.github.com> Date: Fri, 20 Jun 2025 13:47:37 +0800 Subject: [PATCH] According to the NFSv3 protocol: Directory traversal should start with cookie '0' - "." entry as the first entry, cookie should be '0' - '.." entry as the second entry, cookie should be '1' --- src/nfs/nfs_kv_readdir.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nfs/nfs_kv_readdir.cpp b/src/nfs/nfs_kv_readdir.cpp index 97cee3fe..1723eccf 100644 --- a/src/nfs/nfs_kv_readdir.cpp +++ b/src/nfs/nfs_kv_readdir.cpp @@ -166,6 +166,7 @@ resume_2: entryplus3 dotdot = {}; dotdot.name = xdr_copy_string(st->rop->xdrs, ".."); dotdot.fileid = st->dir_ino; + dotdot.cookie = 1; dotdot.name_attributes = (post_op_attr){ // FIXME: maybe do not read parent attributes and leave them to a GETATTR? .attributes_follow = 1,