]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ocfs2-dlm-fix-race-between-convert-and-recovery-v2
authorJoseph Qi <joseph.qi@huawei.com>
Wed, 21 Oct 2015 22:02:46 +0000 (09:02 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:02:46 +0000 (09:02 +1100)
changelog since v1:
Clean up convert_pending since it is now useless.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reported-by: Yiwen Jiang <jiangyiwen@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Tariq Saeed <tariq.x.saeed@oracle.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmconvert.c
fs/ocfs2/dlm/dlmdebug.c
fs/ocfs2/dlm/dlmlock.c

index e88ccf8c83fff7b13310d76745f34697ea4202b5..25853d7884f63915d5ffc9ec64ace08499045031 100644 (file)
@@ -369,7 +369,6 @@ struct dlm_lock
        struct dlm_lockstatus *lksb;
        unsigned ast_pending:1,
                 bast_pending:1,
-                convert_pending:1,
                 lock_pending:1,
                 cancel_pending:1,
                 unlock_pending:1,
index e36d63ff17830bf321a1809d1b81a87827290037..82ba8d58c5e000d9f6ba068d7963d30189c1e843 100644 (file)
@@ -291,7 +291,6 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm,
        /* move lock to local convert queue */
        /* do not alter lock refcount.  switching lists. */
        list_move_tail(&lock->list, &res->converting);
-       lock->convert_pending = 1;
        lock->ml.convert_type = type;
 
        if (flags & LKM_VALBLK) {
@@ -315,7 +314,6 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm,
 
        spin_lock(&res->spinlock);
        res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
-       lock->convert_pending = 0;
        /* if it failed, move it back to granted queue */
        if (status != DLM_NORMAL) {
                if (status != DLM_NOTQUEUED)
index 825136070d2c118d493902b2bb0d24919cd1003a..710e94c52b90f49f167e16e178b2a8ae504a44ee 100644 (file)
@@ -77,7 +77,7 @@ static void __dlm_print_lock(struct dlm_lock *lock)
 
        printk("    type=%d, conv=%d, node=%u, cookie=%u:%llu, "
               "ref=%u, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c), "
-              "pending=(conv=%c,lock=%c,cancel=%c,unlock=%c)\n",
+              "pending=(lock=%c,cancel=%c,unlock=%c)\n",
               lock->ml.type, lock->ml.convert_type, lock->ml.node,
               dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
               dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
@@ -86,7 +86,6 @@ static void __dlm_print_lock(struct dlm_lock *lock)
               (lock->ast_pending ? 'y' : 'n'),
               (list_empty(&lock->bast_list) ? 'y' : 'n'),
               (lock->bast_pending ? 'y' : 'n'),
-              (lock->convert_pending ? 'y' : 'n'),
               (lock->lock_pending ? 'y' : 'n'),
               (lock->cancel_pending ? 'y' : 'n'),
               (lock->unlock_pending ? 'y' : 'n'));
@@ -502,7 +501,7 @@ static int dump_lock(struct dlm_lock *lock, int list_type, char *buf, int len)
 
 #define DEBUG_LOCK_VERSION     1
        spin_lock(&lock->spinlock);
-       out = snprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,%d,"
+       out = snprintf(buf, len, "LOCK:%d,%d,%d,%d,%d,%d:%lld,%d,%d,%d,%d,"
                       "%d,%d,%d,%d\n",
                       DEBUG_LOCK_VERSION,
                       list_type, lock->ml.type, lock->ml.convert_type,
@@ -512,7 +511,7 @@ static int dump_lock(struct dlm_lock *lock, int list_type, char *buf, int len)
                       !list_empty(&lock->ast_list),
                       !list_empty(&lock->bast_list),
                       lock->ast_pending, lock->bast_pending,
-                      lock->convert_pending, lock->lock_pending,
+                      lock->lock_pending,
                       lock->cancel_pending, lock->unlock_pending,
                       atomic_read(&lock->lock_refs.refcount));
        spin_unlock(&lock->spinlock);
index 66c2a491f68d8d5bc2956e59eb3018ab9113cf1d..857dd157799afb6e71e158ae49b60928ddd3db8c 100644 (file)
@@ -411,7 +411,6 @@ static void dlm_init_lock(struct dlm_lock *newlock, int type,
        newlock->ml.cookie = cpu_to_be64(cookie);
        newlock->ast_pending = 0;
        newlock->bast_pending = 0;
-       newlock->convert_pending = 0;
        newlock->lock_pending = 0;
        newlock->unlock_pending = 0;
        newlock->cancel_pending = 0;