mm/hmm: fix build when HMM is disabled
[linux-2.6-block.git] / fs / gfs2 / log.c
index 9a624f6944002af70b75c32c93fc6da1924986f7..f72c442314062c4835ecaa3e0b92b538522f759a 100644 (file)
@@ -898,6 +898,10 @@ static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp)
 static inline int gfs2_ail_flush_reqd(struct gfs2_sbd *sdp)
 {
        unsigned int used_blocks = sdp->sd_jdesc->jd_blocks - atomic_read(&sdp->sd_log_blks_free);
+
+       if (test_and_clear_bit(SDF_FORCE_AIL_FLUSH, &sdp->sd_flags))
+               return 1;
+
        return used_blocks + atomic_read(&sdp->sd_log_blks_needed) >=
                atomic_read(&sdp->sd_log_thresh2);
 }
@@ -919,6 +923,15 @@ int gfs2_logd(void *data)
 
        while (!kthread_should_stop()) {
 
+               /* Check for errors writing to the journal */
+               if (sdp->sd_log_error) {
+                       gfs2_lm_withdraw(sdp,
+                                        "GFS2: fsid=%s: error %d: "
+                                        "withdrawing the file system to "
+                                        "prevent further damage.\n",
+                                        sdp->sd_fsname, sdp->sd_log_error);
+               }
+
                did_flush = false;
                if (gfs2_jrnl_flush_reqd(sdp) || t == 0) {
                        gfs2_ail1_empty(sdp);