Merge tag 'xfs-6.8-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fix from Chandan Babu: - Fix read only mounts when using fsopen mount API * tag 'xfs-6.8-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: read only mounts with fsopen mount API are busted
This commit is contained in:
@@ -1496,6 +1496,18 @@ xfs_fs_fill_super(
|
||||
|
||||
mp->m_super = sb;
|
||||
|
||||
/*
|
||||
* Copy VFS mount flags from the context now that all parameter parsing
|
||||
* is guaranteed to have been completed by either the old mount API or
|
||||
* the newer fsopen/fsconfig API.
|
||||
*/
|
||||
if (fc->sb_flags & SB_RDONLY)
|
||||
set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate);
|
||||
if (fc->sb_flags & SB_DIRSYNC)
|
||||
mp->m_features |= XFS_FEAT_DIRSYNC;
|
||||
if (fc->sb_flags & SB_SYNCHRONOUS)
|
||||
mp->m_features |= XFS_FEAT_WSYNC;
|
||||
|
||||
error = xfs_fs_validate_params(mp);
|
||||
if (error)
|
||||
return error;
|
||||
@@ -1965,6 +1977,11 @@ static const struct fs_context_operations xfs_context_ops = {
|
||||
.free = xfs_fs_free,
|
||||
};
|
||||
|
||||
/*
|
||||
* WARNING: do not initialise any parameters in this function that depend on
|
||||
* mount option parsing having already been performed as this can be called from
|
||||
* fsopen() before any parameters have been set.
|
||||
*/
|
||||
static int xfs_init_fs_context(
|
||||
struct fs_context *fc)
|
||||
{
|
||||
@@ -1996,16 +2013,6 @@ static int xfs_init_fs_context(
|
||||
mp->m_logbsize = -1;
|
||||
mp->m_allocsize_log = 16; /* 64k */
|
||||
|
||||
/*
|
||||
* Copy binary VFS mount flags we are interested in.
|
||||
*/
|
||||
if (fc->sb_flags & SB_RDONLY)
|
||||
set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate);
|
||||
if (fc->sb_flags & SB_DIRSYNC)
|
||||
mp->m_features |= XFS_FEAT_DIRSYNC;
|
||||
if (fc->sb_flags & SB_SYNCHRONOUS)
|
||||
mp->m_features |= XFS_FEAT_WSYNC;
|
||||
|
||||
fc->s_fs_info = mp;
|
||||
fc->ops = &xfs_context_ops;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user