Bug 1361249

Summary: posix: leverage FALLOC_FL_ZERO_RANGE in zerofill fop
Product: [Community] GlusterFS Reporter: Ravishankar N <ravishankar>
Component: posixAssignee: Ravishankar N <ravishankar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.9.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1361483 (view as bug list) Environment:
Last Closed: 2017-03-27 18:17: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: 1361483, 1363750    

Description Ravishankar N 2016-07-28 15:27:11 UTC
posix_zerofill() implements zerofilling of a given (offset,length) by
    doing a writev in a loop followed by an optional fsync on the file.
    fallocate(2) has a FALLOC_FL_ZERO_RANGE flag which does away with all
    this and provides the same result (from a userspace application point of
    view) with a single syscall. This patch attempts the zerofill with the
    latter and falls back to the former if it fails.

    Tested using a libgfapi based C program on XFS and observed using gdb that
    posix_zerofill()'s call to fallocate with FALLOC_FL_ZERO_RANGE was a
    success.

Comment 1 Vijay Bellur 2016-07-28 15:32:05 UTC
REVIEW: http://review.gluster.org/15037 (posix: leverage FALLOC_FL_ZERO_RANGE in zerofill fop) posted (#1) for review on master by Ravishankar N (ravishankar)

Comment 2 Vijay Bellur 2016-07-29 01:28:09 UTC
REVIEW: http://review.gluster.org/15037 (posix: leverage FALLOC_FL_ZERO_RANGE in zerofill fop) posted (#2) for review on master by Ravishankar N (ravishankar)

Comment 3 Vijay Bellur 2016-07-29 07:09:58 UTC
COMMIT: http://review.gluster.org/15037 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit 6d994661db96cad43f26d0d1e2fba31dce9a76f5
Author: Ravishankar N <ravishankar>
Date:   Thu Jul 28 20:42:45 2016 +0530

    posix: leverage FALLOC_FL_ZERO_RANGE in zerofill fop
    
    posix_zerofill() implements zerofilling of a given (offset,length) by
    doing a writev in a loop followed by an optional fsync on the file.
    fallocate(2) has a FALLOC_FL_ZERO_RANGE flag which does away with all
    this and provides the same result (from a userspace application point of
    view) with a single syscall. This patch attempts the zerofill with the
    latter and falls back to the former if it fails.
    
    Tested using a libgfapi based C program on XFS and observed using gdb that
    posix_zerofill()'s call to fallocate with FALLOC_FL_ZERO_RANGE was a
    success.
    
    Change-Id: I77e9b7de0d59c255f06b0c39c43a276990081727
    BUG: 1361249
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: http://review.gluster.org/15037
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>

Comment 4 Shyamsundar 2017-03-27 18:17: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.9.0, please open a new bug report.

glusterfs-3.9.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/gluster-users/2016-November/029281.html
[2] https://www.gluster.org/pipermail/gluster-users/