linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL 12/14 for v6.17] vfs fileattr
Date: Fri, 25 Jul 2025 13:27:18 +0200	[thread overview]
Message-ID: <20250725-vfs-fileattr-fcfc534aac44@brauner> (raw)
In-Reply-To: <20250725-vfs-617-1bcbd4ae2ea6@brauner>

Hey Linus,

/* Summary */
This introduces the new file_getattr() and file_setattr() system calls
after lengthy discussions. Both system calls serve as successors and
extensible companions to the FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR
system calls which have started to show their age in addition to being
named in a way that makes it easy to conflate them with extended
attribute related operations.

These syscalls allow userspace to set filesystem inode attributes on
special files. One of the usage examples is the XFS quota projects.

XFS has project quotas which could be attached to a directory. All new
inodes in these directories inherit project ID set on parent directory.

The project is created from userspace by opening and calling
FS_IOC_FSSETXATTR on each inode. This is not possible for special files
such as FIFO, SOCK, BLK etc. Therefore, some inodes are left with empty
project ID. Those inodes then are not shown in the quota accounting but
still exist in the directory. This is not critical but in the case when
special files are created in the directory with already existing project
quota, these new inodes inherit extended attributes. This creates a mix
of special files with and without attributes. Moreover, special files
with attributes don't have a possibility to become clear or change the
attributes. This, in turn, prevents userspace from re-creating quota
project on these existing files.

In addition, these new system calls allow the implementation of
additional attributes that we couldn't or didn't want to fit into the
legacy ioctls anymore.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

No known conflicts.

The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:

  Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.17-rc1.fileattr

for you to fetch changes up to e85931d1cd699307e6a3f1060cbe4c42748f3fff:

  fs: tighten a sanity check in file_attr_to_fileattr() (2025-07-16 10:22:01 +0200)

Please consider pulling these changes from the signed vfs-6.17-rc1.fileattr tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.17-rc1.fileattr

----------------------------------------------------------------
Amir Goldstein (1):
      fs: prepare for extending file_get/setattr()

Andrey Albershteyn (5):
      fs: split fileattr related helpers into separate file
      lsm: introduce new hooks for setting/getting inode fsxattr
      selinux: implement inode_file_[g|s]etattr hooks
      fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP
      fs: introduce file_getattr and file_setattr syscalls

Christian Brauner (2):
      Merge patch series "fs: introduce file_getattr and file_setattr syscalls"
      tree-wide: s/struct fileattr/struct file_kattr/g

Dan Carpenter (1):
      fs: tighten a sanity check in file_attr_to_fileattr()

 Documentation/filesystems/locking.rst       |   4 +-
 Documentation/filesystems/vfs.rst           |   4 +-
 arch/alpha/kernel/syscalls/syscall.tbl      |   2 +
 arch/arm/tools/syscall.tbl                  |   2 +
 arch/arm64/tools/syscall_32.tbl             |   2 +
 arch/m68k/kernel/syscalls/syscall.tbl       |   2 +
 arch/microblaze/kernel/syscalls/syscall.tbl |   2 +
 arch/mips/kernel/syscalls/syscall_n32.tbl   |   2 +
 arch/mips/kernel/syscalls/syscall_n64.tbl   |   2 +
 arch/mips/kernel/syscalls/syscall_o32.tbl   |   2 +
 arch/parisc/kernel/syscalls/syscall.tbl     |   2 +
 arch/powerpc/kernel/syscalls/syscall.tbl    |   2 +
 arch/s390/kernel/syscalls/syscall.tbl       |   2 +
 arch/sh/kernel/syscalls/syscall.tbl         |   2 +
 arch/sparc/kernel/syscalls/syscall.tbl      |   2 +
 arch/x86/entry/syscalls/syscall_32.tbl      |   2 +
 arch/x86/entry/syscalls/syscall_64.tbl      |   2 +
 arch/xtensa/kernel/syscalls/syscall.tbl     |   2 +
 fs/Makefile                                 |   3 +-
 fs/bcachefs/fs.c                            |   4 +-
 fs/btrfs/ioctl.c                            |   4 +-
 fs/btrfs/ioctl.h                            |   6 +-
 fs/ecryptfs/inode.c                         |   4 +-
 fs/efivarfs/inode.c                         |   4 +-
 fs/ext2/ext2.h                              |   4 +-
 fs/ext2/ioctl.c                             |   4 +-
 fs/ext4/ext4.h                              |   4 +-
 fs/ext4/ioctl.c                             |   4 +-
 fs/f2fs/f2fs.h                              |   4 +-
 fs/f2fs/file.c                              |   4 +-
 fs/file_attr.c                              | 498 ++++++++++++++++++++++++++++
 fs/fuse/fuse_i.h                            |   4 +-
 fs/fuse/ioctl.c                             |   8 +-
 fs/gfs2/file.c                              |   4 +-
 fs/gfs2/inode.h                             |   4 +-
 fs/hfsplus/hfsplus_fs.h                     |   4 +-
 fs/hfsplus/inode.c                          |   4 +-
 fs/ioctl.c                                  | 309 -----------------
 fs/jfs/ioctl.c                              |   4 +-
 fs/jfs/jfs_inode.h                          |   4 +-
 fs/nilfs2/ioctl.c                           |   4 +-
 fs/nilfs2/nilfs.h                           |   4 +-
 fs/ocfs2/ioctl.c                            |   4 +-
 fs/ocfs2/ioctl.h                            |   4 +-
 fs/orangefs/inode.c                         |   4 +-
 fs/overlayfs/copy_up.c                      |   6 +-
 fs/overlayfs/inode.c                        |  17 +-
 fs/overlayfs/overlayfs.h                    |  10 +-
 fs/overlayfs/util.c                         |   2 +-
 fs/ubifs/ioctl.c                            |   4 +-
 fs/ubifs/ubifs.h                            |   4 +-
 fs/xfs/xfs_ioctl.c                          |  18 +-
 fs/xfs/xfs_ioctl.h                          |   4 +-
 include/linux/fileattr.h                    |  38 ++-
 include/linux/fs.h                          |   6 +-
 include/linux/lsm_hook_defs.h               |   2 +
 include/linux/security.h                    |  16 +
 include/linux/syscalls.h                    |   7 +
 include/uapi/asm-generic/unistd.h           |   8 +-
 include/uapi/linux/fs.h                     |  18 +
 mm/shmem.c                                  |   4 +-
 scripts/syscall.tbl                         |   2 +
 security/security.c                         |  30 ++
 security/selinux/hooks.c                    |  14 +
 64 files changed, 752 insertions(+), 410 deletions(-)
 create mode 100644 fs/file_attr.c

  parent reply	other threads:[~2025-07-25 11:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 11:27 [GIT PULL 00/14 for v6.17] vfs 6.17 Christian Brauner
2025-07-25 11:27 ` [GIT PULL 05/14 for v6.17] vfs async dir Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 09/14 for v6.17] vfs bpf Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-29 18:15   ` Alexei Starovoitov
2025-07-31  8:27     ` Christian Brauner
2025-07-31 21:57       ` Alexei Starovoitov
2025-08-04 14:24         ` Christian Brauner
2025-07-25 11:27 ` [GIT PULL 02/14 for v6.17] vfs coredump Christian Brauner
2025-07-28 18:57   ` Linus Torvalds
2025-07-31  9:37     ` Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 06/14 for v6.17] vfs fallocate Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` Christian Brauner [this message]
2025-07-28 23:40   ` [GIT PULL 12/14 for v6.17] vfs fileattr pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 11/14 for v6.17] vfs integrity Christian Brauner
2025-07-28  1:29   ` Hugh Dickins
2025-07-28 22:21     ` Linus Torvalds
2025-07-29  7:49       ` Christoph Hellwig
2025-07-29  8:39         ` Linus Torvalds
2025-07-31  8:00           ` Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 14/14 for v6.17] vfs iomap Christian Brauner
2025-07-27 13:10   ` Sasha Levin
2025-07-28 16:39     ` Joanne Koong
2025-07-31  8:29       ` Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 01/14 for v6.17] vfs misc Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 07/14 for v6.17] vfs mmap Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 04/14 for v6.17] namespace updates Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 03/14 for v6.17] overlayfs Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 08/14 for v6.17] vfs pidfs Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 10/14 for v6.17] vfs rust Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-25 11:27 ` [GIT PULL 13/14 for v6.17] vfs super Christian Brauner
2025-07-28 23:40   ` pr-tracker-bot
2025-07-31  9:40 ` [GIT PULL 00/14 for v6.17] vfs 6.17 Christian Brauner

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=20250725-vfs-fileattr-fcfc534aac44@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).