Skip to content

Commit 815409a

Browse files
committed
Merge tag 'ovl-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull overlayfs update from Miklos Szeredi: - Copy up immutable/append/sync/noatime attributes (Amir Goldstein) - Improve performance by enabling RCU lookup. - Misc fixes and improvements The reason this touches so many files is that the ->get_acl() method now gets a "bool rcu" argument. The ->get_acl() API was updated based on comments from Al and Linus: Link: https://lore.kernel.org/linux-fsdevel/CAJfpeguQxpd6Wgc0Jd3ks77zcsAv_bn0q17L3VNnnmPKu11t8A@mail.gmail.com/ * tag 'ovl-update-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: enable RCU'd ->get_acl() vfs: add rcu argument to ->get_acl() callback ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup() ovl: use kvalloc in xattr copy-up ovl: update ctime when changing fileattr ovl: skip checking lower file's i_writecount on truncate ovl: relax lookup error on mismatch origin ftype ovl: do not set overlay.opaque for new directories ovl: add ovl_allow_offline_changes() helper ovl: disable decoding null uuid with redirect_dir ovl: consistent behavior for immutable/append-only inodes ovl: copy up sync/noatime fileattr flags ovl: pass ovl_fs to ovl_check_setxattr() fs: add generic helper for filling statx attribute flags
2 parents 412106c + 332f606 commit 815409a

File tree

49 files changed

+424
-102
lines changed

Some content is hidden

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

49 files changed

+424
-102
lines changed

Documentation/filesystems/locking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ prototypes::
7070
const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *);
7171
void (*truncate) (struct inode *);
7272
int (*permission) (struct inode *, int, unsigned int);
73-
int (*get_acl)(struct inode *, int);
73+
struct posix_acl * (*get_acl)(struct inode *, int, bool);
7474
int (*setattr) (struct dentry *, struct iattr *);
7575
int (*getattr) (const struct path *, struct kstat *, u32, unsigned int);
7676
ssize_t (*listxattr) (struct dentry *, char *, size_t);

Documentation/filesystems/overlayfs.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ b) If a file residing on a lower layer is opened for read-only and then
427427
memory mapped with MAP_SHARED, then subsequent changes to the file are not
428428
reflected in the memory mapping.
429429

430+
c) If a file residing on a lower layer is being executed, then opening that
431+
file for write or truncating the file will not be denied with ETXTBSY.
432+
430433
The following options allow overlayfs to act more like a standards
431434
compliant filesystem:
432435

Documentation/filesystems/vfs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ As of kernel 2.6.22, the following members are defined:
432432
const char *(*get_link) (struct dentry *, struct inode *,
433433
struct delayed_call *);
434434
int (*permission) (struct user_namespace *, struct inode *, int);
435-
int (*get_acl)(struct inode *, int);
435+
struct posix_acl * (*get_acl)(struct inode *, int, bool);
436436
int (*setattr) (struct user_namespace *, struct dentry *, struct iattr *);
437437
int (*getattr) (struct user_namespace *, const struct path *, struct kstat *, u32, unsigned int);
438438
ssize_t (*listxattr) (struct dentry *, char *, size_t);

fs/9p/acl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ static struct posix_acl *v9fs_get_cached_acl(struct inode *inode, int type)
9797
return acl;
9898
}
9999

100-
struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type)
100+
struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type, bool rcu)
101101
{
102102
struct v9fs_session_info *v9ses;
103103

104+
if (rcu)
105+
return ERR_PTR(-ECHILD);
106+
104107
v9ses = v9fs_inode2v9ses(inode);
105108
if (((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) ||
106109
((v9ses->flags & V9FS_ACL_MASK) != V9FS_POSIX_ACL)) {

fs/9p/acl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#ifdef CONFIG_9P_FS_POSIX_ACL
1818
extern int v9fs_get_acl(struct inode *, struct p9_fid *);
19-
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
19+
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type, bool rcu);
2020
extern int v9fs_acl_chmod(struct inode *, struct p9_fid *);
2121
extern int v9fs_set_create_acl(struct inode *, struct p9_fid *,
2222
struct posix_acl *, struct posix_acl *);

fs/bad_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static const char *bad_inode_get_link(struct dentry *dentry,
121121
return ERR_PTR(-EIO);
122122
}
123123

124-
static struct posix_acl *bad_inode_get_acl(struct inode *inode, int type)
124+
static struct posix_acl *bad_inode_get_acl(struct inode *inode, int type, bool rcu)
125125
{
126126
return ERR_PTR(-EIO);
127127
}

fs/btrfs/acl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
#include "btrfs_inode.h"
1717
#include "xattr.h"
1818

19-
struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
19+
struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu)
2020
{
2121
int size;
2222
const char *name;
2323
char *value = NULL;
2424
struct posix_acl *acl;
2525

26+
if (rcu)
27+
return ERR_PTR(-ECHILD);
28+
2629
switch (type) {
2730
case ACL_TYPE_ACCESS:
2831
name = XATTR_NAME_POSIX_ACL_ACCESS;

fs/btrfs/ctree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
37063706

37073707
/* acl.c */
37083708
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
3709-
struct posix_acl *btrfs_get_acl(struct inode *inode, int type);
3709+
struct posix_acl *btrfs_get_acl(struct inode *inode, int type, bool rcu);
37103710
int btrfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
37113711
struct posix_acl *acl, int type);
37123712
int btrfs_init_acl(struct btrfs_trans_handle *trans,

fs/ceph/acl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ static inline void ceph_set_cached_acl(struct inode *inode,
2929
spin_unlock(&ci->i_ceph_lock);
3030
}
3131

32-
struct posix_acl *ceph_get_acl(struct inode *inode, int type)
32+
struct posix_acl *ceph_get_acl(struct inode *inode, int type, bool rcu)
3333
{
3434
int size;
3535
unsigned int retry_cnt = 0;
3636
const char *name;
3737
char *value = NULL;
3838
struct posix_acl *acl;
3939

40+
if (rcu)
41+
return ERR_PTR(-ECHILD);
42+
4043
switch (type) {
4144
case ACL_TYPE_ACCESS:
4245
name = XATTR_NAME_POSIX_ACL_ACCESS;

fs/ceph/super.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx);
10881088
/* acl.c */
10891089
#ifdef CONFIG_CEPH_FS_POSIX_ACL
10901090

1091-
struct posix_acl *ceph_get_acl(struct inode *, int);
1091+
struct posix_acl *ceph_get_acl(struct inode *, int, bool);
10921092
int ceph_set_acl(struct user_namespace *mnt_userns,
10931093
struct inode *inode, struct posix_acl *acl, int type);
10941094
int ceph_pre_init_acls(struct inode *dir, umode_t *mode,

0 commit comments

Comments
 (0)