diff options
author | Bob Peterson <rpeterso@redhat.com> | 2020-03-26 18:22:05 +0100 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2020-03-27 20:08:05 +0100 |
commit | c953a735c7d4d0d1b092b5c594258a07a84149db (patch) | |
tree | d74622b42e529aec7eb9fb82e5e273bac75c99fa /fs | |
parent | gfs2: instrumentation wrt ail1 stuck (diff) | |
download | linux-c953a735c7d4d0d1b092b5c594258a07a84149db.tar.xz linux-c953a735c7d4d0d1b092b5c594258a07a84149db.zip |
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 <rpeterso@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/recovery.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 34dfdb211439..96c345f49273 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -401,7 +401,7 @@ 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. */ - down_write(&sdp->sd_log_flush_lock); + 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, @@ -412,7 +412,7 @@ void gfs2_recover_func(struct work_struct *work) } clean_journal(jd, &head); - up_write(&sdp->sd_log_flush_lock); + up_read(&sdp->sd_log_flush_lock); gfs2_glock_dq_uninit(&thaw_gh); t_rep = ktime_get(); |