]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/xfs/xfs_log.c
[XFS] Allow punching holes to free space when at ENOSPC
[mv-sheeva.git] / fs / xfs / xfs_log.c
index 635f99e6302ff642f940bd0d448cf6a06760c6f3..9d4c4fbeb3ee2cf4618dd756f2e256760b8f158b 100644 (file)
@@ -817,10 +817,8 @@ xfs_log_need_covered(xfs_mount_t *mp)
        SPLDECL(s);
        int             needed = 0, gen;
        xlog_t          *log = mp->m_log;
-       bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
 
-       if (vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
-           (vfsp->vfs_flag & VFS_RDONLY))
+       if (!xfs_fs_writable(mp))
                return 0;
 
        s = LOG_LOCK(log);
@@ -967,14 +965,16 @@ xlog_iodone(xfs_buf_t *bp)
        } else if (iclog->ic_state & XLOG_STATE_IOERROR) {
                aborted = XFS_LI_ABORTED;
        }
+
+       /* log I/O is always issued ASYNC */
+       ASSERT(XFS_BUF_ISASYNC(bp));
        xlog_state_done_syncing(iclog, aborted);
-       if (!(XFS_BUF_ISASYNC(bp))) {
-               /*
-                * Corresponding psema() will be done in bwrite().  If we don't
-                * vsema() here, panic.
-                */
-               XFS_BUF_V_IODONESEMA(bp);
-       }
+       /*
+        * do not reference the buffer (bp) here as we could race
+        * with it being freed after writing the unmount record to the
+        * log.
+        */
+
 }      /* xlog_iodone */
 
 /*
@@ -1434,7 +1434,7 @@ xlog_sync(xlog_t          *log,
        } else {
                iclog->ic_bwritecnt = 1;
        }
-       XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count);
+       XFS_BUF_SET_COUNT(bp, count);
        XFS_BUF_SET_FSPRIVATE(bp, iclog);       /* save for later */
        XFS_BUF_ZEROFLAGS(bp);
        XFS_BUF_BUSY(bp);