Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Tao Cui <cui.tao@linux.dev>,
	hughd@google.com, david@kernel.org, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, andrealmeid@igalia.com, krisman@suse.de,
	linux-fsdevel@vger.kernel.org, Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH 1/2] shmem: do not inherit FS_CASEFOLD_FL onto non-directories
Date: Tue, 1 Dec 2026 14:09:21 +0800	[thread overview]
Message-ID: <e93cc765-8194-4b5f-848e-738ff935b17e@linux.alibaba.com> (raw)
In-Reply-To: <20261123051629.2547645-2-cui.tao@linux.dev>



On 11/23/26 1:16 PM, Tao Cui wrote:
> From: Tao Cui <cuitao@kylinos.cn>
> 
> __shmem_get_inode() copies the parent's SHMEM_FL_INHERITED flags,
> which include FS_CASEFOLD_FL, onto every new inode and ignores the
> -ENOTDIR that shmem_set_inode_flags() returns for non-directories.
> A regular file created in a casefold directory therefore reports a
> phantom F flag via FS_IOC_GETFLAGS, and chattr, which writes the
> full reported set back, then fails with ENOTDIR on every flag
> change while dropping NOATIME/NODUMP from the same request.
> 
> ext4 and f2fs mask inherited flags by file type; mask
> FS_CASEFOLD_FL for non-directory inodes here too.
> 
> Fixes: 5cd9aecbc72c ("tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs")
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
> ---

Changes look good to me with one nit.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba>

>   mm/shmem.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 1ecda28178e3..46e30b1f5ab8 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -3321,6 +3321,13 @@ static struct inode *__shmem_get_inode(const struct mnt_idmap *idmap,
>   	info->i_crtime = inode_get_mtime(inode);
>   	info->fsflags = (dir == NULL) ? 0 :
>   		SHMEM_I(dir)->fsflags & SHMEM_FL_INHERITED;
> +	/*
> +	 * FS_CASEFOLD_FL is directory-only; mask it for non-directories
> +	 * like ext4_mask_flags()/f2fs_mask_flags() do, or the
> +	 * shmem_set_inode_flags() call below fails with -ENOTDIR.
> +	 */

The comment seems verbose and can be simplified as

/* Only directories inherit the casefold flag. */

?


  reply	other threads:[~2026-12-01  6:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  5:16 [PATCH 0/2] tmpfs: fix casefold flag inheritance and document mount constraints Tao Cui
2026-11-23  5:16 ` [PATCH 1/2] shmem: do not inherit FS_CASEFOLD_FL onto non-directories Tao Cui
2026-12-01  6:09   ` Baolin Wang [this message]
2026-11-23  5:16 ` [PATCH 2/2] Documentation: tmpfs: document casefold option constraints Tao Cui
2026-12-01  6:22   ` Baolin Wang
2026-11-23 15:40 ` [PATCH 0/2] tmpfs: fix casefold flag inheritance and document mount constraints Gabriel Krisman Bertazi

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=e93cc765-8194-4b5f-848e-738ff935b17e@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@igalia.com \
    --cc=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=david@kernel.org \
    --cc=hughd@google.com \
    --cc=krisman@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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