summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 768ab492937..de785420555 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -686,7 +686,11 @@ _posix_do_zerofill(int fd, off_t offset, off_t len, int o_direct)
vector[idx].iov_base = iov_base;
vector[idx].iov_len = vect_size;
}
- lseek(fd, offset, SEEK_SET);
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ op_ret = -1;
+ goto err;
+ }
+
for (idx = 0; idx < num_loop; idx++) {
op_ret = writev(fd, vector, num_vect);
if (op_ret < 0)