From b988754a6dbcd0a3a93c400d86fb9fe4f499e086 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 18 Oct 2024 19:30:05 +0200 Subject: [PATCH] fs/vss: reuse functions from underlying FS OpenFile, Stat and Lstat should reuse the underlying FS implementation to avoid diverging behavior. --- internal/fs/fs_local_vss.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/fs/fs_local_vss.go b/internal/fs/fs_local_vss.go index 54139ab2e..1915e2a7c 100644 --- a/internal/fs/fs_local_vss.go +++ b/internal/fs/fs_local_vss.go @@ -128,17 +128,17 @@ func (fs *LocalVss) DeleteSnapshots() { // OpenFile wraps the Open method of the underlying file system. func (fs *LocalVss) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - return os.OpenFile(fs.snapshotPath(name), flag, perm) + return fs.FS.OpenFile(fs.snapshotPath(name), flag, perm) } // Stat wraps the Stat method of the underlying file system. func (fs *LocalVss) Stat(name string) (os.FileInfo, error) { - return os.Stat(fs.snapshotPath(name)) + return fs.FS.Stat(fs.snapshotPath(name)) } // Lstat wraps the Lstat method of the underlying file system. func (fs *LocalVss) Lstat(name string) (os.FileInfo, error) { - return os.Lstat(fs.snapshotPath(name)) + return fs.FS.Lstat(fs.snapshotPath(name)) } func (fs *LocalVss) NodeFromFileInfo(path string, fi os.FileInfo, ignoreXattrListError bool) (*restic.Node, error) {