[pbs-devel] [PATCH proxmox/proxmox-backup] fix #2915: stat when necessary

Dominik Csapak d.csapak at proxmox.com
Tue Jun 28 13:13:15 CEST 2022


this series implements a fallback to stat'ing files when the
readdir entry does not contain the filetype (since only some
filesystems support that)

i opted for adding the 'FileStat' to the callback in 'scandir'
(even if we don't use it yet) so that we'll not stat again
sometimes when using that. If we want, we can of course omit
that part, then the interface stays as it currently is

we could also write our own 'ReadDir' that stats on demand, but given
how few cases we have where we actually use it, i am not so sure
if the benefits justify the work

proxmox:

Dominik Csapak (1):
  partially fix #2915: proxmox-sys: scandir: stat if file_type is
    unknown

 proxmox-sys/src/fs/read_dir.rs | 36 ++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

proxmox-backup:

Dominik Csapak (2):
  adapt to changed callback signature of 'scandir'
  partially fix #2915: 'stat' in case ReadDirEntry does not contain type

 pbs-datastore/src/backup_info.rs | 23 ++++++++-----
 pbs-datastore/src/chunk_store.rs | 23 ++++++-------
 pbs-datastore/src/hierarchy.rs   | 56 ++++++++++++++++++++++++++++++++
 src/tools/disks/zfs.rs           |  2 +-
 4 files changed, 81 insertions(+), 23 deletions(-)

-- 
2.30.2






More information about the pbs-devel mailing list