[Bugs] [Bug 1158129] New: After readv, md-cache only checks cache times if read was empty
bugzilla at redhat.com
bugzilla at redhat.com
Tue Oct 28 16:10:52 UTC 2014
https://bugzilla.redhat.com/show_bug.cgi?id=1158129
Bug ID: 1158129
Summary: After readv, md-cache only checks cache times if read
was empty
Product: GlusterFS
Version: 3.6.0
Component: core
Severity: medium
Assignee: bugs at gluster.org
Reporter: pspencer at fields.utoronto.ca
CC: bugs at gluster.org, gluster-bugs at redhat.com
Created attachment 951446
--> https://bugzilla.redhat.com/attachment.cgi?id=951446&action=edit
Patch to correct possible error of md-cache skipping cache validation after
successful reads
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).
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list