From 86f2f450d4b2648c645f775bfcdae2ddcff8c705 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 19 Jun 2003 04:43:22 -0500 Subject: [XFS] Fix remount readonly so it really wont write dummy log records SGI Modid: 2.5.x-xfs:slinx:151423a --- fs/xfs/linux/xfs_vfs.h | 2 +- fs/xfs/xfs_vfsops.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/xfs/linux/xfs_vfs.h b/fs/xfs/linux/xfs_vfs.h index c21a76607949..469da44bab75 100644 --- a/fs/xfs/linux/xfs_vfs.h +++ b/fs/xfs/linux/xfs_vfs.h @@ -90,7 +90,7 @@ typedef enum { #define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ - +#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ typedef int (*vfs_mount_t)(bhv_desc_t *, struct xfs_mount_args *, struct cred *); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 2033b947fbbe..e575ffa1ba19 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -599,6 +599,8 @@ out: return XFS_ERROR(error); } +#define REMOUNT_READONLY_FLAGS (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT) + STATIC int xfs_mntupdate( bhv_desc_t *bdp, @@ -623,7 +625,7 @@ xfs_mntupdate( xfs_finish_reclaim_all(mp, 0); do { - VFS_SYNC(vfsp, SYNC_ATTR|SYNC_WAIT, NULL, error); + VFS_SYNC(vfsp, REMOUNT_READONLY_FLAGS, NULL, error); pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT, &pincount); } while (pincount); @@ -1483,7 +1485,7 @@ xfs_syncsub( /* * Now check to see if the log needs a "dummy" transaction. */ - if (xfs_log_need_covered(mp)) { + if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { xfs_trans_t *tp; xfs_inode_t *ip; -- cgit v1.2.3