|
|
d1681e |
From 9656e92cfcd3db351c149e78ca36a4f3cf4c37f3 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Amar Tumballi <amarts@redhat.com>
|
|
|
d1681e |
Date: Fri, 10 Aug 2018 15:28:35 +0530
|
|
|
d1681e |
Subject: [PATCH 338/351] posix: prevent crash when SEEK_DATA/HOLE is not
|
|
|
d1681e |
supported
|
|
|
d1681e |
|
|
|
d1681e |
Instead of not defining the 'seek' fop when it's not supported on the
|
|
|
d1681e |
compilation platform, we simply return EINVAL when it's used.
|
|
|
d1681e |
|
|
|
d1681e |
Upstream reference:
|
|
|
d1681e |
> URL: https://review.gluster.org/20625
|
|
|
d1681e |
> Fixes: bz#1611834
|
|
|
d1681e |
> Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
|
|
|
d1681e |
|
|
|
d1681e |
BUG: 1610825
|
|
|
d1681e |
Change-Id: I253666d8910c5e2fffa3a3ba37085e5c1c058a8e
|
|
|
d1681e |
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/146682
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/storage/posix/src/posix.c | 8 ++++----
|
|
|
d1681e |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
|
|
|
d1681e |
index c3b7120..5203068 100644
|
|
|
d1681e |
--- a/xlators/storage/posix/src/posix.c
|
|
|
d1681e |
+++ b/xlators/storage/posix/src/posix.c
|
|
|
d1681e |
@@ -1184,11 +1184,11 @@ posix_ipc (call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata)
|
|
|
d1681e |
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
-#ifdef HAVE_SEEK_HOLE
|
|
|
d1681e |
static int32_t
|
|
|
d1681e |
posix_seek (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
|
|
|
d1681e |
gf_seek_what_t what, dict_t *xdata)
|
|
|
d1681e |
{
|
|
|
d1681e |
+#ifdef HAVE_SEEK_HOLE
|
|
|
d1681e |
struct posix_fd *pfd = NULL;
|
|
|
d1681e |
off_t ret = -1;
|
|
|
d1681e |
int err = 0;
|
|
|
d1681e |
@@ -1236,9 +1236,11 @@ out:
|
|
|
d1681e |
|
|
|
d1681e |
STACK_UNWIND_STRICT (seek, frame, (ret == -1 ? -1 : 0), err,
|
|
|
d1681e |
(ret == -1 ? -1 : ret), xdata);
|
|
|
d1681e |
+#else
|
|
|
d1681e |
+ STACK_UNWIND_STRICT (seek, frame, -1, EINVAL, 0, NULL);
|
|
|
d1681e |
+#endif
|
|
|
d1681e |
return 0;
|
|
|
d1681e |
}
|
|
|
d1681e |
-#endif
|
|
|
d1681e |
|
|
|
d1681e |
int32_t
|
|
|
d1681e |
posix_opendir (call_frame_t *frame, xlator_t *this,
|
|
|
d1681e |
@@ -8018,9 +8020,7 @@ struct xlator_fops fops = {
|
|
|
d1681e |
.discard = posix_discard,
|
|
|
d1681e |
.zerofill = posix_zerofill,
|
|
|
d1681e |
.ipc = posix_ipc,
|
|
|
d1681e |
-#ifdef HAVE_SEEK_HOLE
|
|
|
d1681e |
.seek = posix_seek,
|
|
|
d1681e |
-#endif
|
|
|
d1681e |
.lease = posix_lease,
|
|
|
d1681e |
};
|
|
|
d1681e |
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|