When we do log recovery on a readonly mount, unlinked inode
processing does not happen due to the readonly checks in
xfs_inactive(), which are trying to prevent any I/O on a
readonly mount.
This is misguided - we do I/O on readonly mounts all the time,
for consistency; for example, log recovery. So do the same
RDONLY flag twiddling around xfs_log_mount_finish() as we
do around xfs_log_mount(), for the same reason.
This all cries out for a big rework but for now this is a
simple fix to an obvious problem.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Orabug:
26630113
Link: https://patchwork.kernel.org/patch/9857173/
move readonly checking into the if statement to apply to the current kernel
Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
xfs_log_mount_finish(xfs_mount_t *mp)
{
int error = 0;
+ int readonly = (mp->m_flags & XFS_MOUNT_RDONLY);
if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) {
+ if (readonly) {
+ /* Allow unlinked processing to proceed */
+ mp->m_flags &= ~XFS_MOUNT_RDONLY;
+ }
error = xlog_recover_finish(mp->m_log);
if (!error)
xfs_log_work_queue(mp);
}
+ if (readonly)
+ mp->m_flags |= XFS_MOUNT_RDONLY;
+
return error;
}