From: "Darrick J. Wong" <djwong@kernel.org>
To: Pavel Reichl <preichl@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] xfs: Skip repetitive warnings about mount options
Date: Wed, 24 Feb 2021 18:41:09 -0800 [thread overview]
Message-ID: <20210225024109.GI7272@magnolia> (raw)
In-Reply-To: <20210224214323.394286-4-preichl@redhat.com>
On Wed, Feb 24, 2021 at 10:43:23PM +0100, Pavel Reichl wrote:
> Skip the warnings about mount option being deprecated if we are
> remounting and deprecated option state is not changing.
>
> Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211605
> Fix-suggested-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
Looks good to me,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_super.c | 24 ++++++++++++++++++++----
> 1 file changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 7e281d1139dc..ba113a28b631 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1155,6 +1155,22 @@ suffix_kstrtoint(
> return ret;
> }
>
> +static inline void
> +xfs_fs_warn_deprecated(
> + struct fs_context *fc,
> + struct fs_parameter *param,
> + uint64_t flag,
> + bool value)
> +{
> + /* Don't print the warning if reconfiguring and current mount point
> + * already had the flag set
> + */
> + if ((fc->purpose & FS_CONTEXT_FOR_RECONFIGURE) &&
> + !!(XFS_M(fc->root->d_sb)->m_flags & flag) == value)
> + return;
> + xfs_warn(fc->s_fs_info, "%s mount option is deprecated.", param->key);
> +}
> +
> /*
> * Set mount state from a mount option.
> *
> @@ -1294,19 +1310,19 @@ xfs_fs_parse_param(
> #endif
> /* Following mount options will be removed in September 2025 */
> case Opt_ikeep:
> - xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
> + xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_IKEEP, true);
> parsing_mp->m_flags |= XFS_MOUNT_IKEEP;
> return 0;
> case Opt_noikeep:
> - xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
> + xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_IKEEP, false);
> parsing_mp->m_flags &= ~XFS_MOUNT_IKEEP;
> return 0;
> case Opt_attr2:
> - xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
> + xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_ATTR2, true);
> parsing_mp->m_flags |= XFS_MOUNT_ATTR2;
> return 0;
> case Opt_noattr2:
> - xfs_warn(parsing_mp, "%s mount option is deprecated.", param->key);
> + xfs_fs_warn_deprecated(fc, param, XFS_MOUNT_NOATTR2, true);
> parsing_mp->m_flags &= ~XFS_MOUNT_ATTR2;
> parsing_mp->m_flags |= XFS_MOUNT_NOATTR2;
> return 0;
> --
> 2.29.2
>
next prev parent reply other threads:[~2021-02-25 2:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 21:43 [PATCH v2 0/2] xfs: Skip repetitive warnings about mount options Pavel Reichl
2021-02-24 21:43 ` [PATCH v2] xfs: Add test for printing deprec. " Pavel Reichl
2021-02-24 21:43 ` [PATCH v2 1/2] xfs: rename variable mp to parsing_mp Pavel Reichl
2021-02-25 2:40 ` Darrick J. Wong
2021-03-09 11:42 ` Carlos Maiolino
2021-02-24 21:43 ` [PATCH v2 2/2] xfs: Skip repetitive warnings about mount options Pavel Reichl
2021-02-25 2:41 ` Darrick J. Wong [this message]
2021-03-09 11:44 ` Carlos Maiolino
-- strict thread matches above, loose matches on Subject: below --
2021-03-19 15:32 [PATCH v2 0/2] " Pavel Reichl
2021-03-19 15:32 ` [PATCH v2 2/2] " Pavel Reichl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210225024109.GI7272@magnolia \
--to=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=preichl@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox