vfs/cbe: fix result of SnapshotsFS.num_dirent("/")

The snapshots file system used to return the number of snapshots on
'num_dirent' when called for the root directory although it was expected to
return 1. This confused the tooling ontop of the VFS.

Ref #4032
This commit is contained in:
Martin Stein 2021-03-15 15:48:37 +01:00 committed by Norman Feske
parent f051bfa90d
commit 4c1eae97cf

View File

@ -3007,7 +3007,10 @@ class Vfs_cbe::Snapshots_file_system : public Vfs::File_system
file_size num_dirent(char const *path) override
{
if (_top_dir(path) || _root_dir(path)) {
if (_top_dir(path)) {
return 1;
}
if (_root_dir(path)) {
_snap_reg.update(_vfs_env);
file_size const num = _snap_reg.number_of_snapshots();
return num;