public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once
@ 2024-09-26 12:34 Christian Ebner
  2024-09-26 12:34 ` [pbs-devel] [PATCH proxmox-backup 2/2] client: pxar: add debug output for exclude pattern matches Christian Ebner
  2024-11-12 20:25 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Ebner @ 2024-09-26 12:34 UTC (permalink / raw)
  To: pbs-devel

While traversing the filesystem tree, `generate_directory_file_list`
generates the list of entries to include for each directory level,
already matching the entry against the given list of match patterns.

Since this already excludes entries which should not be included in
the archive, the same check in the `add_entry` call is redundant,
as it is executed for each entry which is included in the list
generated by `generate_directory_file_list`.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
Seems to be present since commit:
c443f58b09 ("switch to external pxar and fuse crates")

Noticed while looking at the code because an user reported an issue in
the community forum, the issue turned out to be unrelated:
https://forum.proxmox.com/threads/154995/

 pbs-client/src/pxar/create.rs | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index c48524c4c..6129f4a44 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -716,15 +716,6 @@ impl Archiver {
             None => return Ok(()),
         };
 
-        let match_path = PathBuf::from("/").join(self.path.clone());
-        if self
-            .patterns
-            .matches(match_path.as_os_str().as_bytes(), stat.st_mode)?
-            == Some(MatchType::Exclude)
-        {
-            return Ok(());
-        }
-
         let metadata = get_metadata(
             fd.as_raw_fd(),
             stat,
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-13  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-26 12:34 [pbs-devel] [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once Christian Ebner
2024-09-26 12:34 ` [pbs-devel] [PATCH proxmox-backup 2/2] client: pxar: add debug output for exclude pattern matches Christian Ebner
2024-11-12 20:25 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once Thomas Lamprecht
2024-11-13  8:23   ` Christian Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal