diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-11-24 08:31:47 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-11-29 00:46:45 -0800 |
commit | 31927cd4db62b338f4763ce00ab512d20e4d8c32 (patch) | |
tree | 2fcf967320dd04d89ad8faa5da8d6c41ae18a7e7 /xlators/protocol | |
parent | f97dc2f9a196e3c8769652e831be25e36a44e634 (diff) |
protocol/server: capture offset in seek
Problem:
http://review.gluster.org/11482 implemented seek FOP but
http://review.gluster.org/#/c/14137/ 'undid' the change where we pack
the offset returned by seek in server xlator before sending it to the client.
As a result, seek always returns zero to the client for SEEK_HOLE/
SEEK_DATA.
Fix:
I think 14137 removed it unintentionally, hence adding it back again.
> Reviewed-on: http://review.gluster.org/15920
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
(cherry picked from commit cc37e5929d1e3ea4eaf4c4576a82066bf131ad05)
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Change-Id: I67a1f7b53214b043c5291f5704be4a50b698f91c
BUG: 1399130
Reviewed-on: http://review.gluster.org/15943
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/server/src/server-common.c | 6 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-common.h | 3 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-rpc-fops.c | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c index 9a023aaa49e..2cabcf9aec0 100644 --- a/xlators/protocol/server/src/server-common.c +++ b/xlators/protocol/server/src/server-common.c @@ -226,6 +226,12 @@ server_post_fallocate (gfs3_fallocate_rsp *rsp, struct iatt *statpre, gf_stat_from_iatt (&rsp->statpost, statpost); } +void +server_post_seek (gfs3_seek_rsp *rsp, off_t offset) +{ + rsp->offset = offset; +} + int server_post_readdirp (gfs3_readdirp_rsp *rsp, gf_dirent_t *entries) { diff --git a/xlators/protocol/server/src/server-common.h b/xlators/protocol/server/src/server-common.h index afd9fb81269..f3b9ced939c 100644 --- a/xlators/protocol/server/src/server-common.h +++ b/xlators/protocol/server/src/server-common.h @@ -81,6 +81,9 @@ void server_post_fallocate (gfs3_fallocate_rsp *rsp, struct iatt *statpre, struct iatt *statpost); +void +server_post_seek (gfs3_seek_rsp *rsp, off_t offset); + int server_post_readdirp (gfs3_readdirp_rsp *rsp, gf_dirent_t *entries); diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index fa160a52d79..d5410573ac3 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -2008,6 +2008,7 @@ server_seek_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + server_post_seek (&rsp, offset); out: rsp.op_ret = op_ret; rsp.op_errno = gf_errno_to_error (op_errno); |