summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-11-15 22:44:09 +0100
committerVijay Bellur <vbellur@redhat.com>2014-11-19 22:48:02 -0800
commit83a4cdaa1972a16603e19916e093674b60680bb0 (patch)
treed3c8312d68a27a382805bc1a60db52eb09084338
parent4fbc86993a0b0e67bcf58b4882d9d86a8b8ba65a (diff)
md-cache: cache the iatt when readv() was successful
When md-cache is handling a readv callback, its logic is to skip checking the file's iatt (to see if it has changed since the time of the last cache) if "op_ret != 0". This is a mistake, and the intent was to skip only on error; for other fops, op_ret is 0 on success and nonzero on error, and md-cache has the same code for them. For readv, though, op_ret is the number of bytes read, so it will normally be positive except on EOF. BUG: 1164503 Change-Id: Ifc0f2084b41b6f8d075a9260dc7cf69e97535eed Original-author: Philip Spencer <pspencer@fields.utoronto.ca> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9129 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/performance/md-cache/src/md-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 782d258f47c..ae7d06d92f3 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -1455,7 +1455,7 @@ mdc_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local = frame->local;
- if (op_ret != 0)
+ if (op_ret < 0)
goto out;
if (!local)