Skip to content

Commit 57fcb7d

Browse files
committed
Merge tag 'vfs-6.17-rc1.fileattr' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull fileattr updates from Christian Brauner: "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" * tag 'vfs-6.17-rc1.fileattr' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: tighten a sanity check in file_attr_to_fileattr() tree-wide: s/struct fileattr/struct file_kattr/g fs: introduce file_getattr and file_setattr syscalls fs: prepare for extending file_get/setattr() fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP selinux: implement inode_file_[g|s]etattr hooks lsm: introduce new hooks for setting/getting inode fsxattr fs: split fileattr related helpers into separate file
2 parents cec40a7 + e85931d commit 57fcb7d

File tree

64 files changed

+752
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+752
-410
lines changed

Documentation/filesystems/locking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ prototypes::
8787
int (*tmpfile) (struct mnt_idmap *, struct inode *,
8888
struct file *, umode_t);
8989
int (*fileattr_set)(struct mnt_idmap *idmap,
90-
struct dentry *dentry, struct fileattr *fa);
91-
int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
90+
struct dentry *dentry, struct file_kattr *fa);
91+
int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
9292
struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
9393
struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
9494

Documentation/filesystems/vfs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ As of kernel 2.6.22, the following members are defined:
515515
struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
516516
int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
517517
int (*fileattr_set)(struct mnt_idmap *idmap,
518-
struct dentry *dentry, struct fileattr *fa);
519-
int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
518+
struct dentry *dentry, struct file_kattr *fa);
519+
int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
520520
struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
521521
};
522522

arch/alpha/kernel/syscalls/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,3 +507,5 @@
507507
575 common listxattrat sys_listxattrat
508508
576 common removexattrat sys_removexattrat
509509
577 common open_tree_attr sys_open_tree_attr
510+
578 common file_getattr sys_file_getattr
511+
579 common file_setattr sys_file_setattr

arch/arm/tools/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,3 +482,5 @@
482482
465 common listxattrat sys_listxattrat
483483
466 common removexattrat sys_removexattrat
484484
467 common open_tree_attr sys_open_tree_attr
485+
468 common file_getattr sys_file_getattr
486+
469 common file_setattr sys_file_setattr

arch/arm64/tools/syscall_32.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,5 @@
479479
465 common listxattrat sys_listxattrat
480480
466 common removexattrat sys_removexattrat
481481
467 common open_tree_attr sys_open_tree_attr
482+
468 common file_getattr sys_file_getattr
483+
469 common file_setattr sys_file_setattr

arch/m68k/kernel/syscalls/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,3 +467,5 @@
467467
465 common listxattrat sys_listxattrat
468468
466 common removexattrat sys_removexattrat
469469
467 common open_tree_attr sys_open_tree_attr
470+
468 common file_getattr sys_file_getattr
471+
469 common file_setattr sys_file_setattr

arch/microblaze/kernel/syscalls/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,5 @@
473473
465 common listxattrat sys_listxattrat
474474
466 common removexattrat sys_removexattrat
475475
467 common open_tree_attr sys_open_tree_attr
476+
468 common file_getattr sys_file_getattr
477+
469 common file_setattr sys_file_setattr

arch/mips/kernel/syscalls/syscall_n32.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,5 @@
406406
465 n32 listxattrat sys_listxattrat
407407
466 n32 removexattrat sys_removexattrat
408408
467 n32 open_tree_attr sys_open_tree_attr
409+
468 n32 file_getattr sys_file_getattr
410+
469 n32 file_setattr sys_file_setattr

arch/mips/kernel/syscalls/syscall_n64.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,5 @@
382382
465 n64 listxattrat sys_listxattrat
383383
466 n64 removexattrat sys_removexattrat
384384
467 n64 open_tree_attr sys_open_tree_attr
385+
468 n64 file_getattr sys_file_getattr
386+
469 n64 file_setattr sys_file_setattr

arch/mips/kernel/syscalls/syscall_o32.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,5 @@
455455
465 o32 listxattrat sys_listxattrat
456456
466 o32 removexattrat sys_removexattrat
457457
467 o32 open_tree_attr sys_open_tree_attr
458+
468 o32 file_getattr sys_file_getattr
459+
469 o32 file_setattr sys_file_setattr

0 commit comments

Comments
 (0)