Re: [PATCH] cifs: correct superblock flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> SB_NOATIME includes SB_NODIRATIME as a subset. Therefore, setting SB_NOATIME is sufficient

Although technically the flag is not a subset, with current code in
atime_needs_update() setting SB_NODIRATIME is not needed if SB_NOATIME
is already set (see below), but it could be argued that the code is
clearer (easier to understand) to set both flags (especially as it has
no performance hit), and multiple other fs also do this. Any
additional thoughts?

        if (IS_NOATIME(inode))
                return false;
        if ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode))
                return false;h


On Fri, May 30, 2025 at 3:25 AM Yangtao Li <frank.li@xxxxxxxx> wrote:
>
> 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@xxxxxxxx>
> ---
>  fs/smb/client/cifsfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
> index a08c42363ffc..b4bc15ea33bf 100644
> --- a/fs/smb/client/cifsfs.c
> +++ b/fs/smb/client/cifsfs.c
> @@ -996,7 +996,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
>         mnt_data.flags = flags;
>
>         /* BB should we make this contingent on mount parm? */
> -       flags |= SB_NODIRATIME | SB_NOATIME;
> +       flags |= SB_NOATIME;
>
>         sb = sget(fs_type, cifs_match_super, cifs_set_super, flags, &mnt_data);
>         if (IS_ERR(sb)) {
> --
> 2.48.1
>
>


--
Thanks,

Steve





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux