]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: evict all inodes involved with log redo item
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 17 Sep 2017 21:06:16 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:31:57 +0000 (07:31 -0500)
commit90ca6b5db21d75cb2faff804538581f2e681cae0
treeabbfdc894a51c25f6d7c0a0e58a4e2c7d6666f6e
parentedd46d550766d1796d9024db83c259c9cc45f011
xfs: evict all inodes involved with log redo item

BugLink: http://bugs.launchpad.net/bugs/1718412
commit 799ea9e9c59949008770aab4e1da87f10e99dbe4 upstream.

When we introduced the bmap redo log items, we set MS_ACTIVE on the
mountpoint and XFS_IRECOVERY on the inode to prevent unlinked inodes
from being truncated prematurely during log recovery.  This also had the
effect of putting linked inodes on the lru instead of evicting them.

Unfortunately, we neglected to find all those unreferenced lru inodes
and evict them after finishing log recovery, which means that we leak
them if anything goes wrong in the rest of xfs_mountfs, because the lru
is only cleaned out on unmount.

Therefore, evict unreferenced inodes in the lru list immediately
after clearing MS_ACTIVE.

Fixes: 17c12bcd30 ("xfs: when replaying bmap operations, don't let unlinked inodes get reaped")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: viro@ZenIV.linux.org.uk
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/inode.c
fs/internal.h
fs/xfs/xfs_log.c
include/linux/fs.h