[XFS] Barriers need to be dynamically checked and switched off
[deliverable/linux.git] / fs / xfs / xfs_log.c
index 9bfb69e1e885d2fcf7891392c664b4110e4c9161..db09e1ea5cf3146f7ffecc74338e25bdc55677ea 100644 (file)
@@ -948,6 +948,19 @@ xlog_iodone(xfs_buf_t *bp)
         */
        l = iclog->ic_log;
 
+       /*
+        * If the ordered flag has been removed by a lower
+        * layer, it means the underlyin device no longer supports
+        * barrier I/O. Warn loudly and turn off barriers.
+        */
+       if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ORDERED(bp)) {
+               l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER;
+               xfs_fs_cmn_err(CE_WARN, l->l_mp,
+                               "xlog_iodone: Barriers are no longer supported"
+                               " by device. Disabling barriers\n");
+               xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp);
+       }
+
        /*
         * Race to shutdown the filesystem if we see an error.
         */
This page took 0.04382 seconds and 5 git commands to generate.