Print a warning for too big extended attributes

This commit is contained in:
Abogical 2017-02-21 20:38:44 +02:00 committed by Marian Beermann
parent c96cd1adc5
commit d11137dd37
1 changed files with 4 additions and 1 deletions

View File

@ -501,7 +501,10 @@ Number of files: {0.stats.nfiles}'''.format(
try:
xattr.setxattr(fd or path, k, v, follow_symlinks=False)
except OSError as e:
if e.errno not in (errno.ENOTSUP, errno.EACCES):
if e.errno == errno.E2BIG:
logger.warning('%s: Value or key of extended attribute %s is too big for this filesystem' %
(path, k.decode()))
elif e.errno not in (errno.ENOTSUP, errno.EACCES):
# only raise if the errno is not on our ignore list:
# ENOTSUP == xattrs not supported here
# EACCES == permission denied to set this specific xattr