diff options
author | Eric Sandeen <sandeen@redhat.com> | 2015-04-13 11:25:41 +1000 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-06-01 16:25:36 -0400 |
commit | dae27071c5512710ea3062aee42e42c186bce2ca (patch) | |
tree | 1b02774b32c50aec9077f36126584c2f4ca33ce9 /fs | |
parent | 9c887eec6fe91dff902e5ec51c19c8b08e1efb53 (diff) |
xfs: disallow ro->rw remount on norecovery mount
[ Upstream commit bbe051c841d522bf2aaa1d362b57fe47457187bf ]
There's a bit of a loophole in norecovery mount handling right
now: an initial mount must be readonly, but nothing prevents
a mount -o remount,rw from producing a writable, unrecovered
xfs filesystem.
It might be possible to try to perform a log recovery when this
is requested, but I'm not sure it's worth the effort. For now,
simply disallow this sort of transition.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 9f622feda6a4..23222be6dd93 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1248,6 +1248,12 @@ xfs_fs_remount( /* ro -> rw */ if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { + if (mp->m_flags & XFS_MOUNT_NORECOVERY) { + xfs_warn(mp, + "ro->rw transition prohibited on norecovery mount"); + return -EINVAL; + } + mp->m_flags &= ~XFS_MOUNT_RDONLY; /* |