Skip to content

Commit 65512eb

Browse files
committed
Merge tag 'ovl-update-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull overlayfs update from Miklos Szeredi: "Just a small update" * tag 'ovl-update-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: fix spelling mistakes ovl: drop WARN_ON() dentry is NULL in ovl_encode_fh() ovl: improve ovl_get_acl() if POSIX ACL support is off ovl: fix some kernel-doc comments ovl: warn if trusted xattr creation fails
2 parents f72fb74 + 4f11962 commit 65512eb

5 files changed

Lines changed: 21 additions & 8 deletions

File tree

fs/overlayfs/export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static int ovl_encode_fh(struct inode *inode, u32 *fid, int *max_len,
259259
return FILEID_INVALID;
260260

261261
dentry = d_find_any_alias(inode);
262-
if (WARN_ON(!dentry))
262+
if (!dentry)
263263
return FILEID_INVALID;
264264

265265
bytes = ovl_dentry_to_fid(ofs, dentry, fid, buflen);

fs/overlayfs/inode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)
454454
return res;
455455
}
456456

457+
#ifdef CONFIG_FS_POSIX_ACL
457458
/*
458459
* Apply the idmapping of the layer to POSIX ACLs. The caller must pass a clone
459460
* of the POSIX ACLs retrieved from the lower layer to this function to not
@@ -497,7 +498,7 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
497498
struct posix_acl *acl, *clone;
498499
struct path realpath;
499500

500-
if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
501+
if (!IS_POSIXACL(realinode))
501502
return NULL;
502503

503504
/* Careful in RCU walk mode */
@@ -543,6 +544,7 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
543544
posix_acl_release(acl);
544545
return clone;
545546
}
547+
#endif
546548

547549
int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
548550
{

fs/overlayfs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int ovl_check_redirect(struct path *path, struct ovl_lookup_data *d,
4242
* One of the ancestor path elements in an absolute path
4343
* lookup in ovl_lookup_layer() could have been opaque and
4444
* that will stop further lookup in lower layers (d->stop=true)
45-
* But we have found an absolute redirect in decendant path
45+
* But we have found an absolute redirect in descendant path
4646
* element and that should force continue lookup in lower
4747
* layers (reset d->stop).
4848
*/
@@ -648,7 +648,7 @@ static int ovl_get_index_name_fh(struct ovl_fh *fh, struct qstr *name)
648648
* If the index dentry for a copy up origin inode is positive, but points
649649
* to an inode different than the upper inode, then either the upper inode
650650
* has been copied up and not indexed or it was indexed, but since then
651-
* index dir was cleared. Either way, that index cannot be used to indentify
651+
* index dir was cleared. Either way, that index cannot be used to identify
652652
* the overlay inode.
653653
*/
654654
int ovl_get_index_name(struct ovl_fs *ofs, struct dentry *origin,

fs/overlayfs/overlayfs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,13 @@ int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,
590590
int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char *name,
591591
void *value, size_t size);
592592
ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
593+
594+
#ifdef CONFIG_FS_POSIX_ACL
593595
struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu);
596+
#else
597+
#define ovl_get_acl NULL
598+
#endif
599+
594600
int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags);
595601
bool ovl_is_private_xattr(struct super_block *sb, const char *name);
596602

fs/overlayfs/super.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
301301

302302
/**
303303
* ovl_statfs
304-
* @sb: The overlayfs super block
304+
* @dentry: The dentry to query
305305
* @buf: The struct kstatfs to fill in with stats
306306
*
307307
* Get the filesystem statistics. As writes always target the upper layer
@@ -349,6 +349,8 @@ static inline int ovl_xino_def(void)
349349

350350
/**
351351
* ovl_show_options
352+
* @m: the seq_file handle
353+
* @dentry: The dentry to query
352354
*
353355
* Prints the mount options for a given superblock.
354356
* Returns zero; does not fail.
@@ -1412,20 +1414,23 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
14121414
*/
14131415
err = ovl_setxattr(ofs, ofs->workdir, OVL_XATTR_OPAQUE, "0", 1);
14141416
if (err) {
1417+
pr_warn("failed to set xattr on upper\n");
14151418
ofs->noxattr = true;
14161419
if (ofs->config.index || ofs->config.metacopy) {
14171420
ofs->config.index = false;
14181421
ofs->config.metacopy = false;
1419-
pr_warn("upper fs does not support xattr, falling back to index=off,metacopy=off.\n");
1422+
pr_warn("...falling back to index=off,metacopy=off.\n");
14201423
}
14211424
/*
14221425
* xattr support is required for persistent st_ino.
14231426
* Without persistent st_ino, xino=auto falls back to xino=off.
14241427
*/
14251428
if (ofs->config.xino == OVL_XINO_AUTO) {
14261429
ofs->config.xino = OVL_XINO_OFF;
1427-
pr_warn("upper fs does not support xattr, falling back to xino=off.\n");
1430+
pr_warn("...falling back to xino=off.\n");
14281431
}
1432+
if (err == -EPERM && !ofs->config.userxattr)
1433+
pr_info("try mounting with 'userxattr' option\n");
14291434
err = 0;
14301435
} else {
14311436
ovl_removexattr(ofs, ofs->workdir, OVL_XATTR_OPAQUE);
@@ -2032,7 +2037,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
20322037
sb->s_stack_depth = 0;
20332038
sb->s_maxbytes = MAX_LFS_FILESIZE;
20342039
atomic_long_set(&ofs->last_ino, 1);
2035-
/* Assume underlaying fs uses 32bit inodes unless proven otherwise */
2040+
/* Assume underlying fs uses 32bit inodes unless proven otherwise */
20362041
if (ofs->config.xino != OVL_XINO_OFF) {
20372042
ofs->xino_mode = BITS_PER_LONG - 32;
20382043
if (!ofs->xino_mode) {

0 commit comments

Comments
 (0)