summaryrefslogtreecommitdiffstats
path: root/gluster/swift
diff options
context:
space:
mode:
Diffstat (limited to 'gluster/swift')
-rw-r--r--gluster/swift/common/fs_utils.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/gluster/swift/common/fs_utils.py b/gluster/swift/common/fs_utils.py
index b2cacac..8d0b40e 100644
--- a/gluster/swift/common/fs_utils.py
+++ b/gluster/swift/common/fs_utils.py
@@ -239,14 +239,23 @@ def do_close(fd):
try:
fd.close()
except IOError as err:
- raise GlusterFileSystemIOError(
- err.errno, '%s, os.close(%s)' % (err.strerror, fd))
+ if err.errno in (errno.ENOSPC, errno.EDQUOT):
+ do_log_rl("do_close(%s) failed: %s", fd, err)
+ raise DiskFileNoSpace()
+ else:
+ raise GlusterFileSystemIOError(
+ err.errno, '%s, os.close(%s)' % (err.strerror, fd))
else:
try:
os.close(fd)
except OSError as err:
- raise GlusterFileSystemOSError(
- err.errno, '%s, os.close(%s)' % (err.strerror, fd))
+ if err.errno in (errno.ENOSPC, errno.EDQUOT):
+ filename = get_filename_from_fd(fd)
+ do_log_rl("do_close(%d) failed: %s : %s", fd, err, filename)
+ raise DiskFileNoSpace()
+ else:
+ raise GlusterFileSystemOSError(
+ err.errno, '%s, os.close(%s)' % (err.strerror, fd))
def do_unlink(path, log=True):