Bug 1164503

Summary: After readv, md-cache only checks cache times if read was empty
Product: [Community] GlusterFS Reporter: Niels de Vos <ndevos>
Component: coreAssignee: Niels de Vos <ndevos>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs
Target Milestone: ---Keywords: Patch, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.7.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1158129 Environment:
Last Closed: 2015-05-14 17:28:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1158129    

Description Niels de Vos 2014-11-15 21:41:55 UTC
+++ This bug was initially created as a clone of Bug #1158129 +++

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".

I suspect that 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.

The attached patch changes "op_ret != 0" to "op_ret < 0" to skip the check only when an error was returned.

(Or, if the intent was really to check cache validity only on an EOF condition when op_ret is zero, then probably a comment to that effect should be added).

Comment 1 Anand Avati 2014-11-15 21:52:33 UTC
REVIEW: http://review.gluster.org/9129 (md-cache: cache the iatt when readv() was successful) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 2 Anand Avati 2014-11-20 06:48:11 UTC
COMMIT: http://review.gluster.org/9129 committed in master by Vijay Bellur (vbellur) 
------
commit 83a4cdaa1972a16603e19916e093674b60680bb0
Author: Niels de Vos <ndevos>
Date:   Sat Nov 15 22:44:09 2014 +0100

    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.ca>
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/9129
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Xavier Hernandez <xhernandez>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 3 Niels de Vos 2015-05-14 17:28:28 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 4 Niels de Vos 2015-05-14 17:35:43 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 5 Niels de Vos 2015-05-14 17:38:05 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 6 Niels de Vos 2015-05-14 17:44:50 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user