From 83a4cdaa1972a16603e19916e093674b60680bb0 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sat, 15 Nov 2014 22:44:09 +0100 Subject: 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 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/9129 Tested-by: Gluster Build System Reviewed-by: Xavier Hernandez Reviewed-by: Vijay Bellur --- xlators/performance/md-cache/src/md-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit