diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2017-07-11 18:58:04 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-11-22 10:07:36 +0000 |
commit | 038d8f994d66eeb79734c03ecd631a12d5433221 (patch) | |
tree | 480bcb4b91075484e0ee1cd18f08c1a4a5abb788 /xlators/storage/posix/src/posix.c | |
parent | 4ad64ffe8664cc0b964586af6efcf53cc619b68a (diff) |
libglusterfs: Handle FS errors gracefully
Problem:
FS sometimes doesn't give the expected return values. We need our common
functions to guard against this.
Example BUG: https://bugzilla.redhat.com/show_bug.cgi?id=864401
Fix:
When the return value is not as per specification, change the return value
to -1 and errno to EIO
BUG: 1469487
Change-Id: I14739ab2e5ae225b1a91438b87f8928af56f2934
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 479d5c04b29..91e32fc1201 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -836,6 +836,10 @@ posix_do_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = sys_fallocate (pfd->fd, flags, offset, len); if (ret == -1) { ret = -errno; + gf_msg (this->name, GF_LOG_ERROR, -ret, P_MSG_FALLOCATE_FAILED, + "fallocate failed on %s offset: %jd, " + "len:%zu, flags: %d", uuid_utoa (fd->inode->gfid), + offset, len, flags); goto out; } |