From: David Timber <dxdt@dev.snart.me>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH] fat: add noflush mount option
Date: Tue, 25 Aug 2026 10:10:15 +0900 [thread overview]
Message-ID: <787aea79-beb0-4f29-bb67-ee57f6c654c4@dev.snart.me> (raw)
In-Reply-To: <871pbn6edz.fsf@mail.parknet.co.jp>
On 8/24/26 18:45, OGAWA Hirofumi wrote:
> David Timber <dxdt@dev.snart.me> writes:
>
>> On most distros, udisks manages users' removable volume mount requests.
>> Udisks is configured to always mount FAT volumes with the 'flush' mount
>> option. This is largely okay for populating directory in small sizes,
>> but when a large number of files are involved, the flush behaviour acts
>> as a bottleneck point in fat_file_release(). The user may want to
>> disable the flush option temporarily before commencing such an intensive
>> operation.
>>
>> To cover this use case, introduce the new 'noflush' mount option. When
>> used in the mount options to mount a volume, it overrides the 'flush'
>> option previously specified. When used in remount, update it updates the
>> flag.
>>
>> This is a breaking change as traditionally, the mount options other than
>> rw and ro are ignored. The patch breaks this tradition by allowing
>> reconfiguration of 'flush' and 'noflush' mount options.
>>
>> Signed-off-by: David Timber <dxdt@dev.snart.me>
>> ---
>> fs/fat/inode.c | 26 +++++++++++++++++++++-----
>> 1 file changed, 21 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
>> index 28f78df086ef..850df43ba354 100644
>> --- a/fs/fat/inode.c
>> +++ b/fs/fat/inode.c
>> @@ -813,10 +813,14 @@ int fat_reconfigure(struct fs_context *fc)
>> bool new_rdonly;
>> struct super_block *sb = fc->root->d_sb;
>> struct msdos_sb_info *sbi = MSDOS_SB(sb);
>> + struct fat_mount_options *new_opts = fc->fs_private;
>> fc->sb_flags |= SB_NODIRATIME | (sbi->options.isvfat ? 0 : SB_NOATIME);
>>
>> sync_filesystem(sb);
>>
>> + /* allow reconfiguring "flush" or "noflush" */
>> + sbi->options.flush = new_opts->flush;
>> +
>> /* make sure we update state on remount. */
>> new_rdonly = fc->sb_flags & SB_RDONLY;
>> if (new_rdonly != sb_rdonly(sb)) {
> Maybe, better to set after changed the read-only?
ACK
>> @@ -1047,7 +1051,7 @@ enum {
>> Opt_charset, Opt_shortname, Opt_utf8, Opt_utf8_bool,
>> Opt_uni_xl, Opt_uni_xl_bool, Opt_nonumtail, Opt_nonumtail_bool,
>> Opt_obsolete, Opt_flush, Opt_tz, Opt_rodir, Opt_errors, Opt_discard,
>> - Opt_nfs, Opt_nfs_enum, Opt_time_offset, Opt_dos1xfloppy,
>> + Opt_nfs, Opt_nfs_enum, Opt_time_offset, Opt_dos1xfloppy, Opt_noflush
>> };
>>
>> static const struct constant_table fat_param_check[] = {
>> @@ -1110,6 +1114,7 @@ const struct fs_parameter_spec fat_param_spec[] = {
>> fsparam_flag ("debug", Opt_debug),
>> fsparam_flag ("sys_immutable", Opt_immutable),
>> fsparam_flag ("flush", Opt_flush),
>> + fsparam_flag ("noflush", Opt_noflush),
> fsparam_flag() is not including the "noflush" too?
I think I should use fsparam_flag_no() here. My bad.
It seems that you don't object to the idea. That's a good start!
If we want to do this, the
documentation(Documentation/filesystems/vfat.rst and mount(8)) should be
updated, too. fyi, `udisksctl mount -o` won't accept "noflush" so
that'll have to be fixed, too. Also have to make sure if "noflush" is
used in fstab, udisks2 overrides the system default settings.
Davo
next prev parent reply other threads:[~2026-08-25 1:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 17:37 [RFC PATCH] fat: add noflush mount option David Timber
2026-08-24 9:45 ` OGAWA Hirofumi
2026-08-25 1:10 ` David Timber [this message]
2026-08-25 4:31 ` OGAWA Hirofumi
2026-08-25 5:51 ` Christoph Hellwig
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=787aea79-beb0-4f29-bb67-ee57f6c654c4@dev.snart.me \
--to=dxdt@dev.snart.me \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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