|
|
e3c68b |
From 955fea10809861aa9b3da85d386c2cc92b319cdb Mon Sep 17 00:00:00 2001
|
|
|
e3c68b |
From: Barak Sason Rofman <bsasonro@redhat.com>
|
|
|
e3c68b |
Date: Thu, 7 May 2020 18:57:37 +0300
|
|
|
e3c68b |
Subject: [PATCH 372/375] posix - fix seek functionality
|
|
|
e3c68b |
|
|
|
e3c68b |
A wrong pointer check causes the offset returned by seek to be always
|
|
|
e3c68b |
wrong
|
|
|
e3c68b |
|
|
|
e3c68b |
backport of https://review.gluster.org/#/c/glusterfs/+/24412/
|
|
|
e3c68b |
>fixes: #1228
|
|
|
e3c68b |
>Change-Id: Iac4c6a163175617ac4f14544fc6b7c6fb4041cd6
|
|
|
e3c68b |
>Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
|
|
|
e3c68b |
|
|
|
e3c68b |
BUG: 1833017
|
|
|
e3c68b |
Change-Id: Iac4c6a163175617ac4f14544fc6b7c6fb4041cd6
|
|
|
e3c68b |
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
|
|
|
e3c68b |
Reviewed-on: https://code.engineering.redhat.com/gerrit/199761
|
|
|
e3c68b |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
e3c68b |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
e3c68b |
---
|
|
|
e3c68b |
libglusterfs/src/syncop.c | 11 ++++++-----
|
|
|
e3c68b |
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
e3c68b |
|
|
|
e3c68b |
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
|
|
|
e3c68b |
index 0de53c6..693970f 100644
|
|
|
e3c68b |
--- a/libglusterfs/src/syncop.c
|
|
|
e3c68b |
+++ b/libglusterfs/src/syncop.c
|
|
|
e3c68b |
@@ -2881,12 +2881,13 @@ syncop_seek(xlator_t *subvol, fd_t *fd, off_t offset, gf_seek_what_t what,
|
|
|
e3c68b |
SYNCOP(subvol, (&args), syncop_seek_cbk, subvol->fops->seek, fd, offset,
|
|
|
e3c68b |
what, xdata_in);
|
|
|
e3c68b |
|
|
|
e3c68b |
- if (*off)
|
|
|
e3c68b |
- *off = args.offset;
|
|
|
e3c68b |
-
|
|
|
e3c68b |
- if (args.op_ret == -1)
|
|
|
e3c68b |
+ if (args.op_ret < 0) {
|
|
|
e3c68b |
return -args.op_errno;
|
|
|
e3c68b |
- return args.op_ret;
|
|
|
e3c68b |
+ } else {
|
|
|
e3c68b |
+ if (off)
|
|
|
e3c68b |
+ *off = args.offset;
|
|
|
e3c68b |
+ return args.op_ret;
|
|
|
e3c68b |
+ }
|
|
|
e3c68b |
}
|
|
|
e3c68b |
|
|
|
e3c68b |
int
|
|
|
e3c68b |
--
|
|
|
e3c68b |
1.8.3.1
|
|
|
e3c68b |
|