]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: toggle readonly state around xfs_log_mount_finish
authorEric Sandeen <sandeen@sandeen.net>
Fri, 21 Jul 2017 15:25:35 +0000 (10:25 -0500)
committerShan Hai <shan.hai@oracle.com>
Tue, 15 Aug 2017 12:17:51 +0000 (20:17 +0800)
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>
fs/xfs/xfs_log.c

index 39d91a9d0dda2221876c8663b12f9b1a850df652..f5520ea397668ef349eb22eb39781859bf0fb478 100644 (file)
@@ -746,8 +746,13 @@ int
 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);
@@ -756,6 +761,9 @@ xfs_log_mount_finish(xfs_mount_t *mp)
        }
 
 
+       if (readonly)
+               mp->m_flags |= XFS_MOUNT_RDONLY;
+
        return error;
 }