diff options
Diffstat (limited to 'fs/gfs2/daemon.c')
-rw-r--r-- | fs/gfs2/daemon.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/daemon.c b/fs/gfs2/daemon.c index cab1f68d4685..683cb5bda870 100644 --- a/fs/gfs2/daemon.c +++ b/fs/gfs2/daemon.c | |||
@@ -112,6 +112,7 @@ int gfs2_logd(void *data) | |||
112 | struct gfs2_sbd *sdp = data; | 112 | struct gfs2_sbd *sdp = data; |
113 | struct gfs2_holder ji_gh; | 113 | struct gfs2_holder ji_gh; |
114 | unsigned long t; | 114 | unsigned long t; |
115 | int need_flush; | ||
115 | 116 | ||
116 | while (!kthread_should_stop()) { | 117 | while (!kthread_should_stop()) { |
117 | /* Advance the log tail */ | 118 | /* Advance the log tail */ |
@@ -120,8 +121,10 @@ int gfs2_logd(void *data) | |||
120 | gfs2_tune_get(sdp, gt_log_flush_secs) * HZ; | 121 | gfs2_tune_get(sdp, gt_log_flush_secs) * HZ; |
121 | 122 | ||
122 | gfs2_ail1_empty(sdp, DIO_ALL); | 123 | gfs2_ail1_empty(sdp, DIO_ALL); |
123 | 124 | gfs2_log_lock(sdp); | |
124 | if (time_after_eq(jiffies, t)) { | 125 | need_flush = sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks); |
126 | gfs2_log_unlock(sdp); | ||
127 | if (need_flush || time_after_eq(jiffies, t)) { | ||
125 | gfs2_log_flush(sdp, NULL); | 128 | gfs2_log_flush(sdp, NULL); |
126 | sdp->sd_log_flush_time = jiffies; | 129 | sdp->sd_log_flush_time = jiffies; |
127 | } | 130 | } |