Skip to contentSkip to conversation

mm-shmem-fix-chattr-fsflags-support-in-tmpfs.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Aug 17, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/shmem: fix chattr fsflags support in tmpfs
has been removed from the -mm tree. Its filename was
mm-shmem-fix-chattr-fsflags-support-in-tmpfs.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hugh Dickins <[email protected]>
Subject: mm/shmem: fix chattr fsflags support in tmpfs
Date: Wed, 10 Aug 2022 21:51:09 -0700 (PDT)

ext[234] have always allowed unimplemented chattr flags to be set, but other filesystems have tended to be stricter. Follow the stricter approach for tmpfs: I don't want to have to explain why csu attributes don't actually work, and we won't need to update the chattr(1) manpage; and it's never wrong to start off strict, relaxing later if persuaded. Allow only a (append only) i (immutable) A (no atime) and d (no dump).

Although lsattr showed 'A' inherited, the NOATIME behavior was not being
inherited: because nothing sync'ed FS_NOATIME_FL to S_NOATIME. Add shmem_set_inode_flags() to sync the flags, using inode_set_flags() to avoid that instant of lost immutablility during fileattr_set().

But that change switched generic/079 from passing to failing: because FS_IMMUTABLE_FL and FS_APPEND_FL had been unconventionally included in the INHERITED fsflags: remove them and generic/079 is back to passing.

Fixes e408e695f5f1 ("mm/shmem: support FS_IOC_[SG]ETFLAGS in tmpfs")
Cc "Theodore Ts'o" <[email protected]>
Cc Radoslaw Burny <[email protected]>
Cc "Darrick J. Wong" <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>

---

 include/linux/shmem_fs.h |   13 ++------
 mm/shmem.c               |   54 +++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 32 deletions(-)
include/linux/shmem_fs.h renamed from include/linux/shmem_fs.h~mm-shmem-fix-chattr-fsflags-support-in-tmpfs +4 -9
@@ -29,15 +29,10 @@ struct shmem_inode_info {
 	struct inode		vfs_inode;
 };
 
-#define SHMEM_FL_USER_VISIBLE FS_FL_USER_VISIBLE
-#define SHMEM_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE
-#define SHMEM_FL_INHERITED FS_FL_USER_MODIFIABLE
-
-/* Flags that are appropriate for regular files (all but dir-specific ones). */
-#define SHMEM_REG_FLMASK (~(FS_DIRSYNC_FL | FS_TOPDIR_FL))
-
-/* Flags that are appropriate for non-directories/regular files. */
-#define SHMEM_OTHER_FLMASK (FS_NODUMP_FL | FS_NOATIME_FL)
+#define SHMEM_FL_USER_VISIBLE		FS_FL_USER_VISIBLE
+#define SHMEM_FL_USER_MODIFIABLE \
+	(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NODUMP_FL | FS_NOATIME_FL)
+#define SHMEM_FL_INHERITED		(FS_NODUMP_FL | FS_NOATIME_FL)
 
 struct shmem_sb_info {
 	unsigned long max_blocks;   /* How many blocks are allowed */
mm/shmem.c renamed from mm/shmem.c~mm-shmem-fix-chattr-fsflags-support-in-tmpfs +31 -23

84 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are