From b55b4c4da76ff0ec9ebab2b02b2febb575a86965 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 31 Oct 2024 14:55:53 +0000 Subject: [PATCH] CA-400743: perform post snapshot rename in ioretry It appears that SMB3 filers or Windows hosts can return EACCES in response to a rename of a file over one of the links to a file if the rename is done too soon after the hardlink is made. Allow the rename to be retried in the event of EIO or ACCES. Signed-off-by: Mark Syms --- drivers/FileSR.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/FileSR.py b/drivers/FileSR.py index 845f7609..f9b5c02d 100755 --- a/drivers/FileSR.py +++ b/drivers/FileSR.py @@ -803,7 +803,10 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None): "FileSR_fail_snap1", self.__fist_enospace) util.ioretry(lambda: self._snap(tmpsrc, newsrcname)) - self._rename(tmpsrc, src) + # SMB3 can return EACCES if we attempt to rename over the + # hardlink leaf too quickly after creating it. + util.ioretry(lambda: self._rename(tmpsrc, src), + errlist=[errno.EIO, errno.EACCES]) if snap_type == VDI.SNAPSHOT_DOUBLE: # Fault injection site to fail the snapshot with ENOSPACE util.fistpoint.activate_custom_fn(