1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-23 14:41:43 +00:00

Merge pull request #3836 from ThomasWaldmann/fix-3808-master

xattrs: fix borg exception handling on ENOSPC error, fixes #3808
This commit is contained in:
TW 2018-05-18 19:00:59 +02:00 committed by GitHub
commit 6ffb0e1a33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -741,6 +741,13 @@ def restore_attrs(self, path, item, symlink=False, fd=None):
# permission denied to set this specific xattr (this may happen related to security.* keys)
logger.warning('%s: Permission denied when setting extended attribute %s' % (path, k.decode()))
set_ec(EXIT_WARNING)
elif e.errno == errno.ENOSPC:
# no space left on device while setting this specific xattr
# ext4 reports ENOSPC when trying to set an xattr with >4kiB while ext4 can only support 4kiB xattrs
# (in this case, this is NOT a "disk full" error, just a ext4 limitation).
logger.warning('%s: No space left on device while setting extended attribute %s (len = %d)' % (
path, k.decode(), len(v)))
set_ec(EXIT_WARNING)
else:
raise
# bsdflags include the immutable flag and need to be set last: