Bug 1233617

Summary: Introduce an ATOMIC_WRITE flag in posix writev
Product: [Community] GlusterFS Reporter: Krutika Dhananjay <kdhananj>
Component: posixAssignee: Krutika Dhananjay <kdhananj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1236271 (view as bug list) Environment:
Last Closed: 2016-06-16 13:14: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: 1236271    

Description Krutika Dhananjay 2015-06-19 09:48:38 UTC
Description of problem:

posix_writev performs
a) stat (prestat) on the given fd
b) requested write, and
c) stat (poststat) on the given fd

in a lockless manner. When two or more io-threads try to write to the same file in parallel, chances are that the stats gathered per write are not truly reflective of the change (in the number of bytes and blocks) caused by the individual writes. Sometimes it is useful for translators above (like sharding) to know the exact change in the number of bytes per write.

The xlator interested in this behavior could pass a flag in xdata to posix, instructing it to give the precise delta bytes and block count. And posix could ensure this happens by first holding inode->lock, performing a), b) and c) and then unlocking the mutex.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Anand Avati 2015-06-22 11:41:11 UTC
REVIEW: http://review.gluster.org/11345 (storage/posix: Introduce flag instructing posix to perform prestat, writev and poststat atomically) posted (#1) for review on master by Krutika Dhananjay (kdhananj)

Comment 2 Anand Avati 2015-06-23 10:30:47 UTC
REVIEW: http://review.gluster.org/11345 (storage/posix: Introduce flag instructing posix to perform prestat, writev and poststat atomically) posted (#2) for review on master by Krutika Dhananjay (kdhananj)

Comment 3 Anand Avati 2015-06-25 12:07:03 UTC
REVIEW: http://review.gluster.org/11345 (storage/posix: Introduce flag instructing posix to perform prestat, writev and poststat atomically) posted (#3) for review on master by Krutika Dhananjay (kdhananj)

Comment 4 Nagaprasad Sathyanarayana 2015-10-25 15:19:58 UTC
Fix for this BZ is already present in a GlusterFS release. You can find clone of this BZ, fixed in a GlusterFS release and closed. Hence closing this mainline BZ as well.

Comment 5 Niels de Vos 2016-06-16 13:14: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.8.0, please open a new bug report.

glusterfs-3.8.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://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user