From 27c10e0d5a0462f4b958c73537360d1aa7d38e8d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 13 Mar 2020 12:12:38 +0100 Subject: [PATCH] vfs/tar: return inode numbers of null records The tar vfs plugin returns an inode value of zero and a type directory for null records, which wrongly triggers the file-system loop detection of the find utility. This patch returns the node pointer as inode value instead, which is a unique value. Fixes #3695 --- repos/os/src/lib/vfs/tar_file_system.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repos/os/src/lib/vfs/tar_file_system.h b/repos/os/src/lib/vfs/tar_file_system.h index e149f8218..425b50ee2 100644 --- a/repos/os/src/lib/vfs/tar_file_system.h +++ b/repos/os/src/lib/vfs/tar_file_system.h @@ -610,8 +610,14 @@ class Vfs::Tar_file_system : public File_system return STAT_ERR_NO_ENTRY; if (!node_ptr->record) { - out.type = Node_type::DIRECTORY; - out.rwx = Node_rwx::rx(); + out = { + .size = 0, + .type = Node_type::DIRECTORY, + .rwx = Node_rwx::rx(), + .inode = (Genode::addr_t)node_ptr, + .device = (Genode::addr_t)this, + .modification_time = { } + }; return STAT_OK; }