]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/xfs/xfs_log.c
xfs: evict all inodes involved with log redo item
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_log.c
index f467f1230444f6d5d7f1109a3eae820859374edf..bcb2f860e508dc8567d5310713ec9587bf862afc 100644 (file)
@@ -761,12 +761,24 @@ xfs_log_mount_finish(
         * inodes.  Turn it off immediately after recovery finishes
         * so that we don't leak the quota inodes if subsequent mount
         * activities fail.
+        *
+        * We let all inodes involved in redo item processing end up on
+        * the LRU instead of being evicted immediately so that if we do
+        * something to an unlinked inode, the irele won't cause
+        * premature truncation and freeing of the inode, which results
+        * in log recovery failure.  We have to evict the unreferenced
+        * lru inodes after clearing MS_ACTIVE because we don't
+        * otherwise clean up the lru if there's a subsequent failure in
+        * xfs_mountfs, which leads to us leaking the inodes if nothing
+        * else (e.g. quotacheck) references the inodes before the
+        * mount failure occurs.
         */
        mp->m_super->s_flags |= MS_ACTIVE;
        error = xlog_recover_finish(mp->m_log);
        if (!error)
                xfs_log_work_queue(mp);
        mp->m_super->s_flags &= ~MS_ACTIVE;
+       evict_inodes(mp->m_super);
 
        if (readonly)
                mp->m_flags |= XFS_MOUNT_RDONLY;