Skip to content

Commit c953a73

Browse files
committed
gfs2: change from write to read lock for sd_log_flush_lock in journal replay
Function gfs2_recover_func grabs the sd_log_flush_lock rw_semaphore in write mode. This is unnecessary because we only need to prevent log flush from using sd_log_bio bio while it does. Therefore, a read lock will be enough. This is a small step in cleaning up log flush. Signed-off-by: Bob Peterson <[email protected]>
1 parent 9592ea8 commit c953a73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/recovery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ void gfs2_recover_func(struct work_struct *work)
401401
/* We take the sd_log_flush_lock here primarily to prevent log
402402
* flushes and simultaneous journal replays from stomping on
403403
* each other wrt sd_log_bio. */
404-
down_write(&sdp->sd_log_flush_lock);
404+
down_read(&sdp->sd_log_flush_lock);
405405
for (pass = 0; pass < 2; pass++) {
406406
lops_before_scan(jd, &head, pass);
407407
error = foreach_descriptor(jd, head.lh_tail,
@@ -412,7 +412,7 @@ void gfs2_recover_func(struct work_struct *work)
412412
}
413413

414414
clean_journal(jd, &head);
415-
up_write(&sdp->sd_log_flush_lock);
415+
up_read(&sdp->sd_log_flush_lock);
416416

417417
gfs2_glock_dq_uninit(&thaw_gh);
418418
t_rep = ktime_get();

0 commit comments

Comments
 (0)