Bug 1391450 - md-cache: Invalidate cache entry in case of OPEN with O_TRUNC
Summary: md-cache: Invalidate cache entry in case of OPEN with O_TRUNC
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: md-cache
Version: 3.8
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Soumya Koduri
QA Contact:
URL:
Whiteboard:
Depends On: 1382266 1391451
Blocks: 1381968 1391448
TreeView+ depends on / blocked
 
Reported: 2016-11-03 10:59 UTC by Soumya Koduri
Modified: 2016-11-29 09:37 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.8.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1382266
Environment:
Last Closed: 2016-11-29 09:37:17 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Soumya Koduri 2016-11-03 10:59:26 UTC
+++ This bug was initially created as a clone of Bug #1382266 +++

Description of problem:

In case if there is open() done on a file with O_TRUNC posix flag passed, the backend server truncates the file, resulting in change of size of the file. This case needs to be handled by md-cache and should invalidate its cache-entry accordingly.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Worker Ant on 2016-10-06 03:47:11 EDT ---

REVIEW: http://review.gluster.org/15618 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#1) for review on master by soumya k (skoduri)

--- Additional comment from Worker Ant on 2016-10-10 09:12:30 EDT ---

REVIEW: http://review.gluster.org/15618 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#2) for review on master by soumya k (skoduri)

--- Additional comment from Worker Ant on 2016-10-10 09:48:39 EDT ---

REVIEW: http://review.gluster.org/15618 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#3) for review on master by soumya k (skoduri)

--- Additional comment from Worker Ant on 2016-10-14 06:46:40 EDT ---

REVIEW: http://review.gluster.org/15618 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#4) for review on master by soumya k (skoduri)

--- Additional comment from Worker Ant on 2016-10-27 01:46:36 EDT ---

COMMIT: http://review.gluster.org/15618 committed in master by Raghavendra G (rgowdapp) 
------
commit 6ca5d6382f03685b31b12accb095093cf1486603
Author: Soumya Koduri <skoduri>
Date:   Thu Oct 6 13:13:44 2016 +0530

    md-cache: Invalidate cache entry for open() with O_TRUNC
    
    When a file is opened with O_TRUNC flag set, its size gets
    set to '0'. This case needs to be handled in md-cache to
    avoid sending incorrect cached stat.
    
    Change-Id: I95d1f8a6634734898883ede010c3e7b0b7eb97d9
    BUG: 1382266
    Signed-off-by: Soumya Koduri <skoduri>
    Reviewed-on: http://review.gluster.org/15618
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: jiffin tony Thottan <jthottan>
    Tested-by: jiffin tony Thottan <jthottan>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 1 Worker Ant 2016-11-03 10:59:43 UTC
REVIEW: http://review.gluster.org/15771 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#1) for review on release-3.8 by soumya k (skoduri)

Comment 2 Worker Ant 2016-11-03 11:00:55 UTC
REVIEW: http://review.gluster.org/15772 (md-cache: Invalidate cache entry for open() with O_TRUNC) posted (#1) for review on release-3.7 by soumya k (skoduri)

Comment 3 Worker Ant 2016-11-04 03:19:51 UTC
COMMIT: http://review.gluster.org/15771 committed in release-3.8 by Raghavendra G (rgowdapp) 
------
commit b0f4fc9d05a1e5169205b88e81ca0fbdd28b3dd2
Author: Soumya Koduri <skoduri>
Date:   Thu Oct 6 13:13:44 2016 +0530

    md-cache: Invalidate cache entry for open() with O_TRUNC
    
    When a file is opened with O_TRUNC flag set, its size gets
    set to '0'. This case needs to be handled in md-cache to
    avoid sending incorrect cached stat.
    
    This is backport of below mainline patch -
    http://review.gluster.org/#/c/15618/
    
    > Change-Id: I95d1f8a6634734898883ede010c3e7b0b7eb97d9
    > BUG: 1382266
    > Signed-off-by: Soumya Koduri <skoduri>
    > Reviewed-on: http://review.gluster.org/15618
    > Smoke: Gluster Build System <jenkins.org>
    > Reviewed-by: jiffin tony Thottan <jthottan>
    > Tested-by: jiffin tony Thottan <jthottan>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > Reviewed-by: Kaleb KEITHLEY <kkeithle>
    > (cherry picked from commit 6ca5d6382f03685b31b12accb095093cf1486603)
    
    Change-Id: I92349f5b48aef07f3790db7aae25bfa2ddb5947e
    BUG: 1391450
    Signed-off-by: Soumya Koduri <skoduri>
    Reviewed-on: http://review.gluster.org/15771
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 4 Niels de Vos 2016-11-29 09:37:17 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.6, please open a new bug report.

glusterfs-3.8.6 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://www.gluster.org/pipermail/packaging/2016-November/000217.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.