Bug 1587908

Summary: Fix deadlock in failure codepath of shard fsync
Product: [Community] GlusterFS Reporter: Krutika Dhananjay <kdhananj>
Component: shardingAssignee: Krutika Dhananjay <kdhananj>
Status: CLOSED CURRENTRELEASE QA Contact: bugs <bugs>
Severity: high Docs Contact:
Priority: high    
Version: 4.1CC: bugs, jbyers
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-v4.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-20 18:07:27 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:

Description Krutika Dhananjay 2018-06-06 09:53:09 UTC
Description of problem:

        LOCK (&frame->lock);
        {
                if (op_ret < 0) {
                        local->op_ret = op_ret;
                        local->op_errno = op_errno;
                        goto out;
                }
                shard_inode_ctx_set (local->fd->inode, this, postbuf, 0,
                                     SHARD_MASK_TIMES);
        }
        UNLOCK (&frame->lock);

When op_ret is < 0, the control goes to out without unlocking frame->lock.
This can lead to a deadlock.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Krutika Dhananjay 2018-06-06 09:58:01 UTC
https://review.gluster.org/20171

Comment 2 Worker Ant 2018-06-06 14:04:28 UTC
REVISION POSTED: https://review.gluster.org/20171 (features/shard: Fix missing unlock in shard_fsync_shards_cbk()) posted (#2) for review on release-4.1 by Krutika Dhananjay

Comment 3 Worker Ant 2018-06-06 14:04:34 UTC
REVIEW: https://review.gluster.org/20171 (features/shard: Fix missing unlock in shard_fsync_shards_cbk()) posted (#2) for review on release-4.1 by Krutika Dhananjay

Comment 4 Worker Ant 2018-06-08 12:56:26 UTC
COMMIT: https://review.gluster.org/20171 committed in release-4.1 by "Krutika Dhananjay" <kdhananj> with a commit message- features/shard: Fix missing unlock in shard_fsync_shards_cbk()

Backport of:
> Change-Id: I745a98e957cf3c6ba69247fcf6b58dd05cf59c3c
> Signed-off-by: Vijay Bellur <vbellur>
> (cherry picked from commit b21f742f96d46b4adfa87281dd9a2e48fea8d031)
> BUG: 789278

Change-Id: I745a98e957cf3c6ba69247fcf6b58dd05cf59c3c
fixes: bz#1587908
Signed-off-by: Vijay Bellur <vbellur>
(cherry picked from commit b21f742f96d46b4adfa87281dd9a2e48fea8d031)

Comment 5 Shyamsundar 2018-06-20 18:07: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-v4.1.0, please open a new bug report.

glusterfs-v4.1.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-June/000102.html
[2] https://www.gluster.org/pipermail/gluster-users/