From 69778e4c745e289d9f9f9123faa5cdce7e82e0d6 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 8 May 2018 14:46:03 +0200 Subject: [PATCH] xattrs: fix borg exception handling on ENOSPC error, fixes #3808 (cherry picked from commit 959beb867ba3cc6b6fb522d57d8ecd31b443e9f0) --- borg/archive.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/borg/archive.py b/borg/archive.py index 5fe448a6f..381f51dfe 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -510,6 +510,13 @@ Number of files: {0.stats.nfiles}'''.format( # 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 # Only available on OS X and FreeBSD