mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-23 07:07:52 -04:00
Merge pull request #6096 from cuevavirus/master
Workaround for volume shadow copy in WSL1
This commit is contained in:
commit
f2c975ba15
2 changed files with 12 additions and 0 deletions
|
|
@ -99,6 +99,11 @@ General:
|
|||
Using this does not affect data safety, but might result in a more bursty
|
||||
write to disk behaviour (not continuously streaming to disk).
|
||||
|
||||
retry_erofs
|
||||
Retry opening a file without O_NOATIME if opening a file with O_NOATIME
|
||||
caused EROFS. You will need this to make archives from volume shadow copies
|
||||
in WSL1 (Windows Subsystem for Linux 1).
|
||||
|
||||
Some automatic "answerers" (if set, they automatically answer confirmation questions):
|
||||
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
|
||||
For "Warning: Attempting to access a previously unknown unencrypted repository"
|
||||
|
|
|
|||
|
|
@ -286,6 +286,13 @@ def os_open(*, flags, path=None, parent_fd=None, name=None, noatime=False):
|
|||
raise
|
||||
# Was this EPERM due to the O_NOATIME flag? Try again without it:
|
||||
fd = os.open(fname, _flags_normal, dir_fd=parent_fd)
|
||||
except OSError as exc:
|
||||
# O_NOATIME causes EROFS when accessing a volume shadow copy in WSL1
|
||||
from . import workarounds
|
||||
if 'retry_erofs' in workarounds and exc.errno == errno.EROFS and _flags_noatime != _flags_normal:
|
||||
fd = os.open(fname, _flags_normal, dir_fd=parent_fd)
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
fd = os.open(fname, _flags_normal, dir_fd=parent_fd)
|
||||
return fd
|
||||
|
|
|
|||
Loading…
Reference in a new issue