Bug 1524252 - quick-read: Discard cache for fallocate, zerofill and discard ops
Summary: quick-read: Discard cache for fallocate, zerofill and discard ops
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: quick-read
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sachin Prabhu
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1523599
TreeView+ depends on / blocked
 
Reported: 2017-12-11 04:22 UTC by Sachin Prabhu
Modified: 2018-03-15 11:23 UTC (History)
2 users (show)

Fixed In Version: glusterfs-4.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1523599
Environment:
Last Closed: 2018-03-15 11:23:27 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Sachin Prabhu 2017-12-11 04:22:52 UTC
While testing a patch for RFE to add fallocate support to vfs_glusterfs in samba-rhgs, I hit a problem with the read cache created by quick-read not being invalidated in case of glfs_fallocate() or glfs_discard().

To reproduce:

1) untar the attached reproducer.
2) Build the test programs with make all
3) Edit fields in Makefile to set hostname, volume and/or filename/logfile name for test.
4) Run test with make test.

The command writes a 2Kb file with pattern 0x11 for each byte written to the file.
The second call to t_readv first calls discard on half the file. It then reads the file and checks the bytes on the file for 0 in the first half and 1s on the second half.

Expected:
# make test
./t_write vm140-111 gv0 test211 log
./t_readv vm140-111 gv0 test211 log
Success

Actual Result:
# make test
./t_write vm140-111 gv0 test211 log
./t_readv vm140-111 gv0 test211 log
char at position 0 not zeroed out
make: *** [test] Error 251


Attached patch invalidates the cache in quick-read when fallocate, discard or zerofill operations are called.

Comment 1 Worker Ant 2017-12-13 05:25:43 UTC
REVIEW: https://review.gluster.org/19018 (quick-read: Discard cache for fallocate, zerofill and discard ops) posted (#3) for review on master by Sachin Prabhu

Comment 2 Worker Ant 2017-12-13 05:38:12 UTC
COMMIT: https://review.gluster.org/19018 committed in master by \"Sachin Prabhu\" <sprabhu> with a commit message- quick-read: Discard cache for fallocate, zerofill and discard ops

The fallocate, zerofill and discard modify file data on the server thus
rendering stale any cache held by the xlator on the client.

BUG: 1524252
Change-Id: I432146c6390a0cd5869420c373f598da43915f3f
Signed-off-by: Sachin Prabhu <sprabhu>

Comment 3 Shyamsundar 2018-03-15 11:23:27 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-4.0.0, please open a new bug report.

glusterfs-4.0.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://lists.gluster.org/pipermail/announce/2018-March/000092.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.