linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Namjae Jeon" <namjae.jeon@samsung.com>
To: "'Hyunchul Lee'" <hyc.lee@gmail.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"'Sungjong Seo'" <sj1557.seo@samsung.com>
Subject: RE: [PATCH 1/2] exfat: call sync_filesystem for read-only remount
Date: Mon, 15 Jun 2020 09:14:41 +0900	[thread overview]
Message-ID: <001401d642a9$f74c3040$e5e490c0$@samsung.com> (raw)
In-Reply-To: <20200612094250.9347-1-hyc.lee@gmail.com>

Hi Hyunchul,
> We need to commit dirty metadata and pages to disk before remounting exfat as read-only.
> 
> This fixes a failure in xfstests generic/452
Could you please elaborate more the reason why generic/452 in xfstests failed ?
> 
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> ---
>  fs/exfat/super.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/fs/exfat/super.c b/fs/exfat/super.c index e650e65536f8..61c6cf240c19 100644
> --- a/fs/exfat/super.c
> +++ b/fs/exfat/super.c
> @@ -693,10 +693,29 @@ static void exfat_free(struct fs_context *fc)
>  	}
>  }
> 
> +static int exfat_reconfigure(struct fs_context *fc) {
> +	struct super_block *sb = fc->root->d_sb;
> +	int ret;
int ret = 0;
> +	bool new_rdonly;
> +
> +	new_rdonly = fc->sb_flags & SB_RDONLY;
> +	if (new_rdonly != sb_rdonly(sb)) {
If you modify it like this, would not we need new_rdonly?
        if (fc->sb_flags & SB_RDONLY && !sb_rdonly(sb))

> +		if (new_rdonly) {
> +			/* volume flag will be updated in exfat_sync_fs */
> +			ret = sync_filesystem(sb);
> +			if (ret < 0)
> +				return ret;
I think that this ret check can be removed by using return ret; below ?
> +		}
> +	}
> +	return 0;
return ret;
> +}
> +
>  static const struct fs_context_operations exfat_context_ops = {
>  	.parse_param	= exfat_parse_param,
>  	.get_tree	= exfat_get_tree,
>  	.free		= exfat_free,
> +	.reconfigure	= exfat_reconfigure,
>  };
> 
>  static int exfat_init_fs_context(struct fs_context *fc)
> --
> 2.17.1



  parent reply	other threads:[~2020-06-15  0:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200612094312epcas1p1d8be51e8ab6e26b622e3c8437a20cfcf@epcas1p1.samsung.com>
2020-06-12  9:42 ` [PATCH 1/2] exfat: call sync_filesystem for read-only remount Hyunchul Lee
2020-06-12  9:42   ` [PATCH 2/2] exfat: allow to change some mount options for remount Hyunchul Lee
2020-06-15  0:18     ` Namjae Jeon
2020-06-15  2:12       ` Hyunchul Lee
2020-06-15  0:14   ` Namjae Jeon [this message]
2020-06-15  2:10     ` [PATCH 1/2] exfat: call sync_filesystem for read-only remount Hyunchul Lee
2020-06-15  2:56       ` Namjae Jeon

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='001401d642a9$f74c3040$e5e490c0$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=hyc.lee@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.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;
as well as URLs for NNTP newsgroup(s).