[pbs-devel] [PATCH v2 proxmox-backup 4/5] client: pxar: warn user and ignore stale file handles on file open

Christian Ebner c.ebner at proxmox.com
Thu Nov 14 15:41:13 CET 2024


Do not fail hard if a file open fails because of a stale file handle.
Warn the user and ignore the file, just like the client already does
in case of missing privileges to access the file.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 1:
- use report_stale_file_handle helper method

 pbs-client/src/pxar/create.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index a7521424f..3a6e9b157 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -484,6 +484,10 @@ impl Archiver {
                     log::warn!("failed to open file: {:?}: access denied", file_name);
                     Ok(None)
                 }
+                Err(Errno::ESTALE) => {
+                    self.report_stale_file_handle(None);
+                    Ok(None)
+                }
                 Err(Errno::EPERM) if !noatime.is_empty() => {
                     // Retry without O_NOATIME:
                     noatime = OFlag::empty();
-- 
2.39.5





More information about the pbs-devel mailing list