* [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
* [pbs-devel] [PATCH proxmox-backup 2/2] client: pxar: add debug output for exclude pattern matches
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 ` 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
1 sibling, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2024-09-26 12:34 UTC (permalink / raw)
To: pbs-devel
Log the path of directory entries matched by an exclude pattern in
order to more conveniently debug possible issues.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-client/src/pxar/create.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index 6129f4a44..c0c492f8d 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -635,7 +635,10 @@ impl Archiver {
});
match match_result {
- Ok(Some(MatchType::Exclude)) => continue,
+ Ok(Some(MatchType::Exclude)) => {
+ log::debug!("matched by exclude pattern '{full_path:?}'");
+ continue;
+ }
Ok(_) => (),
Err(err) if err.not_found() => continue,
Err(err) => {
--
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
* [pbs-devel] applied: [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once
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 ` Thomas Lamprecht
2024-11-13 8:23 ` Christian Ebner
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2024-11-12 20:25 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Christian Ebner
Am 26.09.24 um 14:34 schrieb Christian Ebner:
> 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")
feel free to add commit references to the commit message itself.
>
> 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(-)
>
>
applied series, thanks!
_______________________________________________
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
* Re: [pbs-devel] applied: [PATCH proxmox-backup 1/2] client: pxar: perform match pattern check only once
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
0 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2024-11-13 8:23 UTC (permalink / raw)
To: Thomas Lamprecht, Proxmox Backup Server development discussion
> On 12.11.2024 21:25 CET Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
>
>
> Am 26.09.24 um 14:34 schrieb Christian Ebner:
> > 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")
>
> feel free to add commit references to the commit message itself.
Acked, will do next time.
Did not include it there directly as it does not really fix anything, just drops redundant code and I investigated why it was introduced like this.
>
> >
> > 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(-)
> >
> >
>
> applied series, thanks!
_______________________________________________
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