Bug 1315557 - SEEK_HOLE and SEEK_DATA should return EINVAL when protocol support is missing
SEEK_HOLE and SEEK_DATA should return EINVAL when protocol support is missing
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: libgfapi (Show other bugs)
3.7.9
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Niels de Vos
Sudhir D
: Triaged
Depends On:
Blocks: glusterfs-3.7.9 1315558 1315559
  Show dependency treegraph
 
Reported: 2016-03-07 23:31 EST by Niels de Vos
Modified: 2016-04-19 03:20 EDT (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.7.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1315558 1315559 (view as bug list)
Environment:
Last Closed: 2016-04-19 03:20:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Niels de Vos 2016-03-07 23:31:21 EST
Description of problem:
GlusterFS 3.7 and earlier do not have support for the (new) SEEK FOP. There is no check in glfs_lseek() for unknown SEEK_* operations, this needs to be added

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

How reproducible:
100%

Steps to Reproduce:
1. call glfs_lseek(..., ..., SEEK_DATA)

Actual results:
No error is returned.

Expected results:
-1 should get returned, and errno should have been set to EINVAL.

Additional info:
Found through code inspection while replying to http://lists.nongnu.org/archive/html/qemu-block/2016-03/msg00119.html
Comment 1 Vijay Bellur 2016-03-07 23:50:31 EST
REVIEW: http://review.gluster.org/13631 (gfapi: return EINVAL for unsupported  lseek() operations) posted (#1) for review on release-3.7 by Niels de Vos (ndevos@redhat.com)
Comment 2 Vijay Bellur 2016-03-08 16:28:48 EST
REVIEW: http://review.gluster.org/13631 (gfapi: return EINVAL for unsupported  lseek() operations) posted (#2) for review on release-3.7 by Vijay Bellur (vbellur@redhat.com)
Comment 3 Vijay Bellur 2016-03-09 07:03:29 EST
COMMIT: http://review.gluster.org/13631 committed in release-3.7 by Vijay Bellur (vbellur@redhat.com) 
------
commit ba1a401e142ad8884f9d3f13c51f7d5b17d008fc
Author: Niels de Vos <ndevos@redhat.com>
Date:   Tue Mar 8 05:39:01 2016 +0100

    gfapi: return EINVAL for unsupported  lseek() operations
    
    GlusterFS 3.8 contains support for SEEK_DATA/SEEK_HOLE. This protocol
    extension is not available in 3.7. libgfapi needs to handle unsupported
    SEEK_* operations correctly, by returning -1 and setting errno to
    EINVAL.
    
    This change is different from the patch in the master branch, it is only
    needed to do the improved error checking in this version.
    
    BUG: 1315557
    Change-Id: I142dde11923244809b03fcca8cd4c2f7d5ff3929
    Signed-off-by: Niels de Vos <ndevos@redhat.com>
    Reviewed-on: http://review.gluster.org/13631
    Smoke: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
    NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Comment 4 Kaushal 2016-04-19 03:20:46 EDT
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.9, please open a new bug report.

glusterfs-3.7.9 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] https://www.gluster.org/pipermail/gluster-users/2016-March/025922.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

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