• Darrick J. Wong's avatar
    xfs: clear MS_ACTIVE after finishing log recovery · 8204f8dd
    Darrick J. Wong authored
    Way back when we established inode block-map redo log items, it was
    discovered that we needed to prevent the VFS from evicting inodes during
    log recovery because any given inode might be have bmap redo items to
    replay even if the inode has no link count and is ultimately deleted,
    and any eviction of an unlinked inode causes the inode to be truncated
    and freed too early.
    
    To make this possible, we set MS_ACTIVE so that inodes would not be torn
    down immediately upon release.  Unfortunately, this also results in the
    quota inodes not being released at all if a later part of the mount
    process should fail, because we never reclaim the inodes.  So, set
    MS_ACTIVE right before we do the last part of log recovery and clear it
    immediately after we finish the log recovery so that everything
    will be torn down properly if we abort the mount.
    
    Fixes: 17c12bcd ("xfs: when replaying bmap operations, don't let unlinked inodes get reaped")
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
    8204f8dd
xfs_mount.c 35.3 KB