lkml.org 
[lkml]   [2010]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[12/59] ocfs2/dlm: remove potential deadlock -V3
    2.6.32-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Wengang Wang <wen.gang.wang@oracle.com>

    commit b11f1f1ab73fd358b1b734a9427744802202ba68 upstream.

    When we need to take both dlm_domain_lock and dlm->spinlock, we should take
    them in order of: dlm_domain_lock then dlm->spinlock.

    There is pathes disobey this order. That is calling dlm_lockres_put() with
    dlm->spinlock held in dlm_run_purge_list. dlm_lockres_put() calls dlm_put() at
    the ref and dlm_put() locks on dlm_domain_lock.

    Fix:
    Don't grab/put the dlm when the initialising/releasing lockres.
    That grab is not required because we don't call dlm_unregister_domain()
    based on refcount.

    Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
    Signed-off-by: Joel Becker <joel.becker@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    fs/ocfs2/dlm/dlmmaster.c | 4 ----
    1 file changed, 4 deletions(-)

    --- a/fs/ocfs2/dlm/dlmmaster.c
    +++ b/fs/ocfs2/dlm/dlmmaster.c
    @@ -511,8 +511,6 @@ static void dlm_lockres_release(struct k

    atomic_dec(&dlm->res_cur_count);

    - dlm_put(dlm);
    -
    if (!hlist_unhashed(&res->hash_node) ||
    !list_empty(&res->granted) ||
    !list_empty(&res->converting) ||
    @@ -585,8 +583,6 @@ static void dlm_init_lockres(struct dlm_
    res->migration_pending = 0;
    res->inflight_locks = 0;

    - /* put in dlm_lockres_release */
    - dlm_grab(dlm);
    res->dlm = dlm;

    kref_init(&res->refs);



    \
     
     \ /
      Last update: 2010-08-25 01:51    [W:4.169 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site