linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Hugh Dickins <hughd@google.com>, linux-mm@kvack.org
Subject: Re: [PATCH] mm/shmem: add support for FS_IOC_[SG]ETFLAGS for tmpfs
Date: Wed, 13 Jul 2022 12:11:22 -0700	[thread overview]
Message-ID: <20220713121122.a0cce6a35cdd734c3b2df12d@linux-foundation.org> (raw)
In-Reply-To: <20220713145234.2356641-1-tytso@mit.edu>

On Wed, 13 Jul 2022 10:52:34 -0400 "Theodore Ts'o" <tytso@mit.edu> wrote:

> This allows userspace to set flags like FS_APPEND_FL, FS_IMMUTABLE_FL,
> FS_NODUMP_FL, etc., like all other standard Linux file systems.
> 
> ...
>
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -28,6 +28,7 @@
>  #include <linux/ramfs.h>
>  #include <linux/pagemap.h>
>  #include <linux/file.h>
> +#include <linux/fileattr.h>
>  #include <linux/mm.h>
>  #include <linux/random.h>
>  #include <linux/sched/signal.h>
> @@ -1058,6 +1059,15 @@ static int shmem_getattr(struct user_namespace *mnt_userns,
>  		shmem_recalc_inode(inode);
>  		spin_unlock_irq(&info->lock);
>  	}
> +	if (info->fsflags & EXT2_APPEND_FL)
> +		stat->attributes |= STATX_ATTR_APPEND;
> +	if (info->fsflags & EXT2_IMMUTABLE_FL)
> +		stat->attributes |= STATX_ATTR_IMMUTABLE;
> +	if (info->fsflags & EXT2_NODUMP_FL)
> +		stat->attributes |= STATX_ATTR_NODUMP;
> +	stat->attributes_mask |= (STATX_ATTR_APPEND |
> +			STATX_ATTR_IMMUTABLE |
> +			STATX_ATTR_NODUMP);
>  	generic_fillattr(&init_user_ns, inode, stat);
>  
>  	if (shmem_is_huge(NULL, inode, 0))

hm, how did you even test this?

mm/shmem.c: In function 'shmem_getattr':
mm/shmem.c:1062:29: error: 'EXT2_APPEND_FL' undeclared (first use in this function); did you mean 'FS_APPEND_FL'?
 1062 |         if (info->fsflags & EXT2_APPEND_FL)
      |                             ^~~~~~~~~~~~~~
      |                             FS_APPEND_FL


this

--- a/mm/shmem.c~mm-shmem-add-support-for-fs_ioc_etflags-for-tmpfs-fix-2
+++ a/mm/shmem.c
@@ -40,6 +40,8 @@
 #include <linux/swapfile.h>
 #include "swap.h"
 
+#include <../fs/ext2/ext2.h>
+
 static struct vfsmount *shm_mnt;
 
 #ifdef CONFIG_SHMEM

seems quite wrong.


  reply	other threads:[~2022-07-13 19:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 14:52 Theodore Ts'o
2022-07-13 19:11 ` Andrew Morton [this message]
2022-07-14  1:40   ` Theodore Ts'o
2022-07-14  2:24     ` [PATCH -v2] mm/shmem: support FS_IOC_[SG]ETFLAGS in tmpfs Theodore Ts'o
2022-07-15  1:59       ` [PATCH -v3] " Theodore Ts'o
2022-07-20 11:10         ` Theodore Ts'o
2022-07-20 16:59           ` Andrew Morton
2022-08-11  4:44         ` Hugh Dickins
2022-07-14 23:01 ` [PATCH] mm/shmem: add support for FS_IOC_[SG]ETFLAGS for tmpfs kernel test robot
2022-07-15 11:09   ` Arnd Bergmann
2022-07-15 11:36     ` Theodore Ts'o
2022-07-14 23:11 ` kernel test robot

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=20220713121122.a0cce6a35cdd734c3b2df12d@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=tytso@mit.edu \
    /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