diff options
| -rw-r--r-- | fs/gfs2/log.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 4df349c7f022..5028a9d00c17 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
| @@ -918,12 +918,15 @@ int gfs2_logd(void *data) | |||
| 918 | struct gfs2_sbd *sdp = data; | 918 | struct gfs2_sbd *sdp = data; |
| 919 | unsigned long t = 1; | 919 | unsigned long t = 1; |
| 920 | DEFINE_WAIT(wait); | 920 | DEFINE_WAIT(wait); |
| 921 | bool did_flush; | ||
| 921 | 922 | ||
| 922 | while (!kthread_should_stop()) { | 923 | while (!kthread_should_stop()) { |
| 923 | 924 | ||
| 925 | did_flush = false; | ||
| 924 | if (gfs2_jrnl_flush_reqd(sdp) || t == 0) { | 926 | if (gfs2_jrnl_flush_reqd(sdp) || t == 0) { |
| 925 | gfs2_ail1_empty(sdp); | 927 | gfs2_ail1_empty(sdp); |
| 926 | gfs2_log_flush(sdp, NULL, NORMAL_FLUSH); | 928 | gfs2_log_flush(sdp, NULL, NORMAL_FLUSH); |
| 929 | did_flush = true; | ||
| 927 | } | 930 | } |
| 928 | 931 | ||
| 929 | if (gfs2_ail_flush_reqd(sdp)) { | 932 | if (gfs2_ail_flush_reqd(sdp)) { |
| @@ -931,9 +934,10 @@ int gfs2_logd(void *data) | |||
| 931 | gfs2_ail1_wait(sdp); | 934 | gfs2_ail1_wait(sdp); |
| 932 | gfs2_ail1_empty(sdp); | 935 | gfs2_ail1_empty(sdp); |
| 933 | gfs2_log_flush(sdp, NULL, NORMAL_FLUSH); | 936 | gfs2_log_flush(sdp, NULL, NORMAL_FLUSH); |
| 937 | did_flush = true; | ||
| 934 | } | 938 | } |
| 935 | 939 | ||
| 936 | if (!gfs2_ail_flush_reqd(sdp)) | 940 | if (!gfs2_ail_flush_reqd(sdp) || did_flush) |
| 937 | wake_up(&sdp->sd_log_waitq); | 941 | wake_up(&sdp->sd_log_waitq); |
| 938 | 942 | ||
| 939 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; | 943 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; |
