]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/gfs2/glock.c
Merge tag 'for-linus-4.7-2' of git://git.code.sf.net/p/openipmi/linux-ipmi
[karo-tx-linux.git] / fs / gfs2 / glock.c
index 6539131c52a24fd7f694866fc041dbbe1e09b8f5..706fd9352f368818391ad79f4481feffe0809b60 100644 (file)
@@ -218,7 +218,7 @@ static void gfs2_holder_wake(struct gfs2_holder *gh)
  *
  */
 
-static inline void do_error(struct gfs2_glock *gl, const int ret)
+static void do_error(struct gfs2_glock *gl, const int ret)
 {
        struct gfs2_holder *gh, *tmp;
 
@@ -475,7 +475,14 @@ __acquires(&gl->gl_lockref.lock)
        if (sdp->sd_lockstruct.ls_ops->lm_lock) {
                /* lock_dlm */
                ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
-               if (ret) {
+               if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
+                   target == LM_ST_UNLOCKED &&
+                   test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags)) {
+                       finish_xmote(gl, target);
+                       if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
+                               gfs2_glock_put(gl);
+               }
+               else if (ret) {
                        pr_err("lm_lock ret %d\n", ret);
                        GLOCK_BUG_ON(gl, 1);
                }
@@ -1913,7 +1920,7 @@ static int gfs2_glocks_open(struct inode *inode, struct file *file)
                if (seq->buf)
                        seq->size = GFS2_SEQ_GOODSIZE;
                gi->gl = NULL;
-               ret = rhashtable_walk_init(&gl_hash_table, &gi->hti);
+               ret = rhashtable_walk_init(&gl_hash_table, &gi->hti, GFP_KERNEL);
        }
        return ret;
 }
@@ -1941,7 +1948,7 @@ static int gfs2_glstats_open(struct inode *inode, struct file *file)
                if (seq->buf)
                        seq->size = GFS2_SEQ_GOODSIZE;
                gi->gl = NULL;
-               ret = rhashtable_walk_init(&gl_hash_table, &gi->hti);
+               ret = rhashtable_walk_init(&gl_hash_table, &gi->hti, GFP_KERNEL);
        }
        return ret;
 }