io-wq: fix double put of 'wq' in error path
[linux-2.6-microblaze.git] / fs / gfs2 / recovery.c
index 74ab1fc..2821737 100644 (file)
@@ -505,15 +505,17 @@ void gfs2_recover_func(struct work_struct *work)
 
                /* We take the sd_log_flush_lock here primarily to prevent log
                 * flushes and simultaneous journal replays from stomping on
-                * each other wrt sd_log_bio. */
+                * each other wrt jd_log_bio. */
                down_read(&sdp->sd_log_flush_lock);
                for (pass = 0; pass < 2; pass++) {
                        lops_before_scan(jd, &head, pass);
                        error = foreach_descriptor(jd, head.lh_tail,
                                                   head.lh_blkno, pass);
                        lops_after_scan(jd, error, pass);
-                       if (error)
+                       if (error) {
+                               up_read(&sdp->sd_log_flush_lock);
                                goto fail_gunlock_thaw;
+                       }
                }
 
                recover_local_statfs(jd, &head);