All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fat: correct superblock flags
@ 2025-05-30  8:46 Yangtao Li
  2025-05-30 10:23 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2025-05-30  8:46 UTC (permalink / raw)
  To: hirofumi; +Cc: linux-kernel, Yangtao Li

SB_NOATIME includes SB_NODIRATIME as a subset. Therefore,
setting SB_NOATIME is sufficient to disable atime updates
for all files and directories.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/fat/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 3852bb66358c..5da96c37386d 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -807,7 +807,7 @@ 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);
-	fc->sb_flags |= SB_NODIRATIME | (sbi->options.isvfat ? 0 : SB_NOATIME);
+	fc->sb_flags |= sbi->options.isvfat ? SB_NODIRATIME : SB_NOATIME;
 
 	sync_filesystem(sb);
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fat: correct superblock flags
  2025-05-30  8:46 [PATCH] fat: correct superblock flags Yangtao Li
@ 2025-05-30 10:23 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2025-05-30 10:23 UTC (permalink / raw)
  To: Yangtao Li; +Cc: linux-kernel

Yangtao Li <frank.li@vivo.com> writes:

> SB_NOATIME includes SB_NODIRATIME as a subset. Therefore,
> setting SB_NOATIME is sufficient to disable atime updates
> for all files and directories.

SB_NODIRATIME is set at fat_fill_super(). So always SB_NODIRATIME looks
like it is consistent even if meaningless than removing only if remount.

Thanks.

> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/fat/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 3852bb66358c..5da96c37386d 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -807,7 +807,7 @@ 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);
> -	fc->sb_flags |= SB_NODIRATIME | (sbi->options.isvfat ? 0 : SB_NOATIME);
> +	fc->sb_flags |= sbi->options.isvfat ? SB_NODIRATIME : SB_NOATIME;
>  
>  	sync_filesystem(sb);

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-30 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  8:46 [PATCH] fat: correct superblock flags Yangtao Li
2025-05-30 10:23 ` OGAWA Hirofumi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.