[Bugs] [Bug 1393677] stat of file is hung with possible deadlock

bugzilla at redhat.com bugzilla at redhat.com
Thu Nov 24 05:44:28 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1393677



--- Comment #3 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: http://review.gluster.org/15817 committed in release-3.9 by Pranith
Kumar Karampuri (pkarampu at redhat.com) 
------
commit 73b0debb4f489f671e3fcd33b2c70ca9f3a2b70a
Author: Pranith Kumar K <pkarampu at redhat.com>
Date:   Wed Nov 9 13:07:25 2016 +0530

    performance/open-behind: Avoid deadlock in statedump

    Problem:
    open-behind is taking fd->lock then inode->lock where as statedump is
taking
    inode->lock then fd->lock, so it is leading to deadlock

    In open-behind, following code exists:
    void
    ob_fd_free (ob_fd_t *ob_fd)
    {
            loc_wipe (&ob_fd->loc); <<--- this takes (inode->lock)
    .......
    }

    int
    ob_wake_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 int op_ret, int op_errno, fd_t *fd_ret, dict_t *xdata)
    {
        .......
            LOCK (&fd->lock); <<---- fd->lock
            {
        .......
                    __fd_ctx_del (fd, this, NULL);
                    ob_fd_free (ob_fd); <<<---------------
            }
            UNLOCK (&fd->lock);
    .......
    }
    =================================================================
    In statedump this code exists:
    inode_dump (inode_t *inode, char *prefix)
    {
    .......
        ret = TRY_LOCK(&inode->lock); <<---- inode->lock
    .......
        fd_ctx_dump (fd, prefix); <<<-----
    .......
    }
    fd_ctx_dump (fd_t *fd, char *prefix)
    {
    .......
            LOCK (&fd->lock); <<<------------------ this takes fd-lock
            {
    .......
    }

    Fix:
    Make sure open-behind doesn't call ob_fd_free() inside fd->lock

     >BUG: 1393259
     >Change-Id: I4abdcfc5216270fa1e2b43f7b73445f49e6d6e6e
     >Signed-off-by: Pranith Kumar K <pkarampu at redhat.com>
     >Reviewed-on: http://review.gluster.org/15808
     >Smoke: Gluster Build System <jenkins at build.gluster.org>
     >NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
     >CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
     >Reviewed-by: Poornima G <pgurusid at redhat.com>
     >Reviewed-by: Raghavendra G <rgowdapp at redhat.com>

    BUG: 1393677
    Change-Id: I45a0fbed683ef6acb7900df87534927f332fdaaa
    Signed-off-by: Pranith Kumar K <pkarampu at redhat.com>
    Reviewed-on: http://review.gluster.org/15817
    Smoke: Gluster Build System <jenkins at build.gluster.org>
    NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
    Reviewed-by: Poornima G <pgurusid at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=ZU6T6o1GEO&a=cc_unsubscribe


More information about the Bugs mailing list