net/mlx4_en: Fix potential deadlock in port statistics flow
[cascardo/linux.git] / fs / gfs2 / glock.c
index 3a90b2b..14cbf60 100644 (file)
@@ -69,7 +69,7 @@ static atomic_t lru_count = ATOMIC_INIT(0);
 static DEFINE_SPINLOCK(lru_lock);
 
 #define GFS2_GL_HASH_SHIFT      15
-#define GFS2_GL_HASH_SIZE       (1 << GFS2_GL_HASH_SHIFT)
+#define GFS2_GL_HASH_SIZE       BIT(GFS2_GL_HASH_SHIFT)
 
 static struct rhashtable_params ht_parms = {
        .nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4,
@@ -1781,7 +1781,13 @@ int __init gfs2_glock_init(void)
                return -ENOMEM;
        }
 
-       register_shrinker(&glock_shrinker);
+       ret = register_shrinker(&glock_shrinker);
+       if (ret) {
+               destroy_workqueue(gfs2_delete_workqueue);
+               destroy_workqueue(glock_workqueue);
+               rhashtable_destroy(&gl_hash_table);
+               return ret;
+       }
 
        return 0;
 }