]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/xfs/xfs_mount.c
xfs: quiesce the filesystem after recovery on readonly mount
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / xfs_mount.c
index faeead671f9ff02af6ca9c797a1480611ed4c95b..56e85a6c85c7681689d5b985f367bb7c3ac95b5f 100644 (file)
@@ -933,6 +933,20 @@ xfs_mountfs(
                goto out_rtunmount;
        }
 
+       /*
+        * Now the log is fully replayed, we can transition to full read-only
+        * mode for read-only mounts. This will sync all the metadata and clean
+        * the log so that the recovery we just performed does not have to be
+        * replayed again on the next mount.
+        *
+        * We use the same quiesce mechanism as the rw->ro remount, as they are
+        * semantically identical operations.
+        */
+       if ((mp->m_flags & (XFS_MOUNT_RDONLY|XFS_MOUNT_NORECOVERY)) ==
+                                                       XFS_MOUNT_RDONLY) {
+               xfs_quiesce_attr(mp);
+       }
+
        /*
         * Complete the quota initialisation, post-log-replay component.
         */