mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
ovl: Check for casefold consistency when creating new dentries
In a overlayfs with casefold enabled, all new dentries should have casefold enabled as well. Check this at ovl_create_real(). Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: André Almeida <andrealmeid@igalia.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
This commit is contained in:
parent
f9377faaea
commit
dfc7da402c
|
|
@ -187,6 +187,13 @@ struct dentry *ovl_create_real(struct ovl_fs *ofs, struct dentry *parent,
|
|||
/* mkdir is special... */
|
||||
newdentry = ovl_do_mkdir(ofs, dir, newdentry, attr->mode);
|
||||
err = PTR_ERR_OR_ZERO(newdentry);
|
||||
/* expect to inherit casefolding from workdir/upperdir */
|
||||
if (!err && ofs->casefold != ovl_dentry_casefolded(newdentry)) {
|
||||
pr_warn_ratelimited("wrong inherited casefold (%pd2)\n",
|
||||
newdentry);
|
||||
dput(newdentry);
|
||||
err = -EINVAL;
|
||||
}
|
||||
break;
|
||||
|
||||
case S_IFCHR:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user