Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs

Pull overlayfs fixes from Miklos Szeredi:
"Most of this is regression fixes for posix acl behavior introduced in
4.8-rc1 (these were caught by the pjd-fstest suite). The are also
miscellaneous fixes marked as stable material and cleanups.

Other than overlayfs code, it touches <linux/fs.h> to add a constant
with which to disable posix acl caching. No changes needed to the
actual caching code, it automatically does the right thing, although
later we may want to optimize this case.

I'm now testing overlayfs with the following test suites to catch
regressions:

- unionmount-testsuite
- xfstests
- pjd-fstest"

* 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
ovl: update doc
ovl: listxattr: use strnlen()
ovl: Switch to generic_getxattr
ovl: copyattr after setting POSIX ACL
ovl: Switch to generic_removexattr
ovl: Get rid of ovl_xattr_noacl_handlers array
ovl: Fix OVL_XATTR_PREFIX
ovl: fix spelling mistake: "directries" -> "directories"
ovl: don't cache acl on overlay layer
ovl: use cached acl on underlying layer
ovl: proper cleanup of workdir
ovl: remove posix_acl_default from workdir
ovl: handle umask and posix_acl_default correctly on creation
ovl: don't copy up opaqueness

+246 -104
+3 -5
Documentation/filesystems/overlayfs.txt
··· 183 183 moves it over to the old name. The new file may be on a different 184 184 filesystem, so both st_dev and st_ino of the file may change. 185 185 186 - Any open files referring to this inode will access the old data and 187 - metadata. Similarly any file locks obtained before copy_up will not 188 - apply to the copied up file. 186 + Any open files referring to this inode will access the old data. 189 187 190 - On a file opened with O_RDONLY fchmod(2), fchown(2), futimesat(2) and 191 - fsetxattr(2) will fail with EROFS. 188 + Any file locks (and leases) obtained before copy_up will not apply 189 + to the copied up file. 192 190 193 191 If a file with multiple hard links is copied up, then this will 194 192 "break" the link. Changes will not be propagated to other names
+2
fs/overlayfs/copy_up.c
··· 80 80 } 81 81 82 82 for (name = buf; name < (buf + list_size); name += strlen(name) + 1) { 83 + if (ovl_is_private_xattr(name)) 84 + continue; 83 85 retry: 84 86 size = vfs_getxattr(old, name, value, value_size); 85 87 if (size == -ERANGE)
+56 -2
fs/overlayfs/dir.c
··· 12 12 #include <linux/xattr.h> 13 13 #include <linux/security.h> 14 14 #include <linux/cred.h> 15 + #include <linux/posix_acl.h> 16 + #include <linux/posix_acl_xattr.h> 15 17 #include "overlayfs.h" 16 18 17 19 void ovl_cleanup(struct inode *wdir, struct dentry *wdentry) ··· 188 186 struct dentry *newdentry; 189 187 int err; 190 188 189 + if (!hardlink && !IS_POSIXACL(udir)) 190 + stat->mode &= ~current_umask(); 191 + 191 192 inode_lock_nested(udir, I_MUTEX_PARENT); 192 193 newdentry = lookup_one_len(dentry->d_name.name, upperdir, 193 194 dentry->d_name.len); ··· 340 335 return ret; 341 336 } 342 337 338 + static int ovl_set_upper_acl(struct dentry *upperdentry, const char *name, 339 + const struct posix_acl *acl) 340 + { 341 + void *buffer; 342 + size_t size; 343 + int err; 344 + 345 + if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !acl) 346 + return 0; 347 + 348 + size = posix_acl_to_xattr(NULL, acl, NULL, 0); 349 + buffer = kmalloc(size, GFP_KERNEL); 350 + if (!buffer) 351 + return -ENOMEM; 352 + 353 + size = posix_acl_to_xattr(&init_user_ns, acl, buffer, size); 354 + err = size; 355 + if (err < 0) 356 + goto out_free; 357 + 358 + err = vfs_setxattr(upperdentry, name, buffer, size, XATTR_CREATE); 359 + out_free: 360 + kfree(buffer); 361 + return err; 362 + } 363 + 343 364 static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode, 344 365 struct kstat *stat, const char *link, 345 366 struct dentry *hardlink) ··· 377 346 struct dentry *upper; 378 347 struct dentry *newdentry; 379 348 int err; 349 + struct posix_acl *acl, *default_acl; 380 350 381 351 if (WARN_ON(!workdir)) 382 352 return -EROFS; 353 + 354 + if (!hardlink) { 355 + err = posix_acl_create(dentry->d_parent->d_inode, 356 + &stat->mode, &default_acl, &acl); 357 + if (err) 358 + return err; 359 + } 383 360 384 361 err = ovl_lock_rename_workdir(workdir, upperdir); 385 362 if (err) ··· 423 384 if (err) 424 385 goto out_cleanup; 425 386 } 387 + if (!hardlink) { 388 + err = ovl_set_upper_acl(newdentry, XATTR_NAME_POSIX_ACL_ACCESS, 389 + acl); 390 + if (err) 391 + goto out_cleanup; 392 + 393 + err = ovl_set_upper_acl(newdentry, XATTR_NAME_POSIX_ACL_DEFAULT, 394 + default_acl); 395 + if (err) 396 + goto out_cleanup; 397 + } 426 398 427 399 if (!hardlink && S_ISDIR(stat->mode)) { 428 400 err = ovl_set_opaque(newdentry); ··· 460 410 out_unlock: 461 411 unlock_rename(workdir, upperdir); 462 412 out: 413 + if (!hardlink) { 414 + posix_acl_release(acl); 415 + posix_acl_release(default_acl); 416 + } 463 417 return err; 464 418 465 419 out_cleanup: ··· 1004 950 .permission = ovl_permission, 1005 951 .getattr = ovl_dir_getattr, 1006 952 .setxattr = generic_setxattr, 1007 - .getxattr = ovl_getxattr, 953 + .getxattr = generic_getxattr, 1008 954 .listxattr = ovl_listxattr, 1009 - .removexattr = ovl_removexattr, 955 + .removexattr = generic_removexattr, 1010 956 .get_acl = ovl_get_acl, 1011 957 .update_time = ovl_update_time, 1012 958 };
+44 -64
fs/overlayfs/inode.c
··· 10 10 #include <linux/fs.h> 11 11 #include <linux/slab.h> 12 12 #include <linux/xattr.h> 13 + #include <linux/posix_acl.h> 13 14 #include "overlayfs.h" 14 15 15 16 static int ovl_copy_up_truncate(struct dentry *dentry) ··· 192 191 return err; 193 192 } 194 193 195 - static bool ovl_is_private_xattr(const char *name) 194 + bool ovl_is_private_xattr(const char *name) 196 195 { 197 - #define OVL_XATTR_PRE_NAME OVL_XATTR_PREFIX "." 198 - return strncmp(name, OVL_XATTR_PRE_NAME, 199 - sizeof(OVL_XATTR_PRE_NAME) - 1) == 0; 196 + return strncmp(name, OVL_XATTR_PREFIX, 197 + sizeof(OVL_XATTR_PREFIX) - 1) == 0; 200 198 } 201 199 202 - int ovl_setxattr(struct dentry *dentry, struct inode *inode, 203 - const char *name, const void *value, 204 - size_t size, int flags) 200 + int ovl_xattr_set(struct dentry *dentry, const char *name, const void *value, 201 + size_t size, int flags) 205 202 { 206 203 int err; 207 - struct dentry *upperdentry; 204 + struct path realpath; 205 + enum ovl_path_type type = ovl_path_real(dentry, &realpath); 208 206 const struct cred *old_cred; 209 207 210 208 err = ovl_want_write(dentry); 211 209 if (err) 212 210 goto out; 213 211 212 + if (!value && !OVL_TYPE_UPPER(type)) { 213 + err = vfs_getxattr(realpath.dentry, name, NULL, 0); 214 + if (err < 0) 215 + goto out_drop_write; 216 + } 217 + 214 218 err = ovl_copy_up(dentry); 215 219 if (err) 216 220 goto out_drop_write; 217 221 218 - upperdentry = ovl_dentry_upper(dentry); 222 + if (!OVL_TYPE_UPPER(type)) 223 + ovl_path_upper(dentry, &realpath); 224 + 219 225 old_cred = ovl_override_creds(dentry->d_sb); 220 - err = vfs_setxattr(upperdentry, name, value, size, flags); 226 + if (value) 227 + err = vfs_setxattr(realpath.dentry, name, value, size, flags); 228 + else { 229 + WARN_ON(flags != XATTR_REPLACE); 230 + err = vfs_removexattr(realpath.dentry, name); 231 + } 221 232 revert_creds(old_cred); 222 233 223 234 out_drop_write: ··· 238 225 return err; 239 226 } 240 227 241 - ssize_t ovl_getxattr(struct dentry *dentry, struct inode *inode, 242 - const char *name, void *value, size_t size) 228 + int ovl_xattr_get(struct dentry *dentry, const char *name, 229 + void *value, size_t size) 243 230 { 244 231 struct dentry *realdentry = ovl_dentry_real(dentry); 245 232 ssize_t res; 246 233 const struct cred *old_cred; 247 - 248 - if (ovl_is_private_xattr(name)) 249 - return -ENODATA; 250 234 251 235 old_cred = ovl_override_creds(dentry->d_sb); 252 236 res = vfs_getxattr(realdentry, name, value, size); ··· 255 245 { 256 246 struct dentry *realdentry = ovl_dentry_real(dentry); 257 247 ssize_t res; 258 - int off; 248 + size_t len; 249 + char *s; 259 250 const struct cred *old_cred; 260 251 261 252 old_cred = ovl_override_creds(dentry->d_sb); ··· 266 255 return res; 267 256 268 257 /* filter out private xattrs */ 269 - for (off = 0; off < res;) { 270 - char *s = list + off; 271 - size_t slen = strlen(s) + 1; 258 + for (s = list, len = res; len;) { 259 + size_t slen = strnlen(s, len) + 1; 272 260 273 - BUG_ON(off + slen > res); 261 + /* underlying fs providing us with an broken xattr list? */ 262 + if (WARN_ON(slen > len)) 263 + return -EIO; 274 264 265 + len -= slen; 275 266 if (ovl_is_private_xattr(s)) { 276 267 res -= slen; 277 - memmove(s, s + slen, res - off); 268 + memmove(s, s + slen, len); 278 269 } else { 279 - off += slen; 270 + s += slen; 280 271 } 281 272 } 282 273 283 274 return res; 284 - } 285 - 286 - int ovl_removexattr(struct dentry *dentry, const char *name) 287 - { 288 - int err; 289 - struct path realpath; 290 - enum ovl_path_type type = ovl_path_real(dentry, &realpath); 291 - const struct cred *old_cred; 292 - 293 - err = ovl_want_write(dentry); 294 - if (err) 295 - goto out; 296 - 297 - err = -ENODATA; 298 - if (ovl_is_private_xattr(name)) 299 - goto out_drop_write; 300 - 301 - if (!OVL_TYPE_UPPER(type)) { 302 - err = vfs_getxattr(realpath.dentry, name, NULL, 0); 303 - if (err < 0) 304 - goto out_drop_write; 305 - 306 - err = ovl_copy_up(dentry); 307 - if (err) 308 - goto out_drop_write; 309 - 310 - ovl_path_upper(dentry, &realpath); 311 - } 312 - 313 - old_cred = ovl_override_creds(dentry->d_sb); 314 - err = vfs_removexattr(realpath.dentry, name); 315 - revert_creds(old_cred); 316 - out_drop_write: 317 - ovl_drop_write(dentry); 318 - out: 319 - return err; 320 275 } 321 276 322 277 struct posix_acl *ovl_get_acl(struct inode *inode, int type) ··· 291 314 const struct cred *old_cred; 292 315 struct posix_acl *acl; 293 316 294 - if (!IS_POSIXACL(realinode)) 317 + if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode)) 295 318 return NULL; 296 319 297 320 if (!realinode->i_op->get_acl) 298 321 return NULL; 299 322 300 323 old_cred = ovl_override_creds(inode->i_sb); 301 - acl = realinode->i_op->get_acl(realinode, type); 324 + acl = get_acl(realinode, type); 302 325 revert_creds(old_cred); 303 326 304 327 return acl; ··· 368 391 .permission = ovl_permission, 369 392 .getattr = ovl_getattr, 370 393 .setxattr = generic_setxattr, 371 - .getxattr = ovl_getxattr, 394 + .getxattr = generic_getxattr, 372 395 .listxattr = ovl_listxattr, 373 - .removexattr = ovl_removexattr, 396 + .removexattr = generic_removexattr, 374 397 .get_acl = ovl_get_acl, 375 398 .update_time = ovl_update_time, 376 399 }; ··· 381 404 .readlink = ovl_readlink, 382 405 .getattr = ovl_getattr, 383 406 .setxattr = generic_setxattr, 384 - .getxattr = ovl_getxattr, 407 + .getxattr = generic_getxattr, 385 408 .listxattr = ovl_listxattr, 386 - .removexattr = ovl_removexattr, 409 + .removexattr = generic_removexattr, 387 410 .update_time = ovl_update_time, 388 411 }; 389 412 ··· 392 415 inode->i_ino = get_next_ino(); 393 416 inode->i_mode = mode; 394 417 inode->i_flags |= S_NOCMTIME; 418 + #ifdef CONFIG_FS_POSIX_ACL 419 + inode->i_acl = inode->i_default_acl = ACL_DONT_CACHE; 420 + #endif 395 421 396 422 mode &= S_IFMT; 397 423 switch (mode) {
+9 -8
fs/overlayfs/overlayfs.h
··· 24 24 (OVL_TYPE_MERGE(type) || !OVL_TYPE_UPPER(type)) 25 25 26 26 27 - #define OVL_XATTR_PREFIX XATTR_TRUSTED_PREFIX "overlay" 28 - #define OVL_XATTR_OPAQUE OVL_XATTR_PREFIX ".opaque" 27 + #define OVL_XATTR_PREFIX XATTR_TRUSTED_PREFIX "overlay." 28 + #define OVL_XATTR_OPAQUE OVL_XATTR_PREFIX "opaque" 29 29 30 30 #define OVL_ISUPPER_MASK 1UL 31 31 ··· 179 179 void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list); 180 180 void ovl_cache_free(struct list_head *list); 181 181 int ovl_check_d_type_supported(struct path *realpath); 182 + void ovl_workdir_cleanup(struct inode *dir, struct vfsmount *mnt, 183 + struct dentry *dentry, int level); 182 184 183 185 /* inode.c */ 184 186 int ovl_setattr(struct dentry *dentry, struct iattr *attr); 185 187 int ovl_permission(struct inode *inode, int mask); 186 - int ovl_setxattr(struct dentry *dentry, struct inode *inode, 187 - const char *name, const void *value, 188 - size_t size, int flags); 189 - ssize_t ovl_getxattr(struct dentry *dentry, struct inode *inode, 190 - const char *name, void *value, size_t size); 188 + int ovl_xattr_set(struct dentry *dentry, const char *name, const void *value, 189 + size_t size, int flags); 190 + int ovl_xattr_get(struct dentry *dentry, const char *name, 191 + void *value, size_t size); 191 192 ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); 192 - int ovl_removexattr(struct dentry *dentry, const char *name); 193 193 struct posix_acl *ovl_get_acl(struct inode *inode, int type); 194 194 int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); 195 195 int ovl_update_time(struct inode *inode, struct timespec *ts, int flags); 196 + bool ovl_is_private_xattr(const char *name); 196 197 197 198 struct inode *ovl_new_inode(struct super_block *sb, umode_t mode); 198 199 struct inode *ovl_get_inode(struct super_block *sb, struct inode *realinode);
+62 -1
fs/overlayfs/readdir.c
··· 248 248 err = rdd->err; 249 249 } while (!err && rdd->count); 250 250 251 - if (!err && rdd->first_maybe_whiteout) 251 + if (!err && rdd->first_maybe_whiteout && rdd->dentry) 252 252 err = ovl_check_whiteouts(realpath->dentry, rdd); 253 253 254 254 fput(realfile); ··· 605 605 return err; 606 606 607 607 return rdd.d_type_supported; 608 + } 609 + 610 + static void ovl_workdir_cleanup_recurse(struct path *path, int level) 611 + { 612 + int err; 613 + struct inode *dir = path->dentry->d_inode; 614 + LIST_HEAD(list); 615 + struct ovl_cache_entry *p; 616 + struct ovl_readdir_data rdd = { 617 + .ctx.actor = ovl_fill_merge, 618 + .dentry = NULL, 619 + .list = &list, 620 + .root = RB_ROOT, 621 + .is_lowest = false, 622 + }; 623 + 624 + err = ovl_dir_read(path, &rdd); 625 + if (err) 626 + goto out; 627 + 628 + inode_lock_nested(dir, I_MUTEX_PARENT); 629 + list_for_each_entry(p, &list, l_node) { 630 + struct dentry *dentry; 631 + 632 + if (p->name[0] == '.') { 633 + if (p->len == 1) 634 + continue; 635 + if (p->len == 2 && p->name[1] == '.') 636 + continue; 637 + } 638 + dentry = lookup_one_len(p->name, path->dentry, p->len); 639 + if (IS_ERR(dentry)) 640 + continue; 641 + if (dentry->d_inode) 642 + ovl_workdir_cleanup(dir, path->mnt, dentry, level); 643 + dput(dentry); 644 + } 645 + inode_unlock(dir); 646 + out: 647 + ovl_cache_free(&list); 648 + } 649 + 650 + void ovl_workdir_cleanup(struct inode *dir, struct vfsmount *mnt, 651 + struct dentry *dentry, int level) 652 + { 653 + int err; 654 + 655 + if (!d_is_dir(dentry) || level > 1) { 656 + ovl_cleanup(dir, dentry); 657 + return; 658 + } 659 + 660 + err = ovl_do_rmdir(dir, dentry); 661 + if (err) { 662 + struct path path = { .mnt = mnt, .dentry = dentry }; 663 + 664 + inode_unlock(dir); 665 + ovl_workdir_cleanup_recurse(&path, level + 1); 666 + inode_lock_nested(dir, I_MUTEX_PARENT); 667 + ovl_cleanup(dir, dentry); 668 + } 608 669 }
+69 -24
fs/overlayfs/super.c
··· 814 814 struct kstat stat = { 815 815 .mode = S_IFDIR | 0, 816 816 }; 817 + struct iattr attr = { 818 + .ia_valid = ATTR_MODE, 819 + .ia_mode = stat.mode, 820 + }; 817 821 818 822 if (work->d_inode) { 819 823 err = -EEXIST; ··· 825 821 goto out_dput; 826 822 827 823 retried = true; 828 - ovl_cleanup(dir, work); 824 + ovl_workdir_cleanup(dir, mnt, work, 0); 829 825 dput(work); 830 826 goto retry; 831 827 } 832 828 833 829 err = ovl_create_real(dir, work, &stat, NULL, NULL, true); 830 + if (err) 831 + goto out_dput; 832 + 833 + err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT); 834 + if (err && err != -ENODATA) 835 + goto out_dput; 836 + 837 + err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS); 838 + if (err && err != -ENODATA) 839 + goto out_dput; 840 + 841 + /* Clear any inherited mode bits */ 842 + inode_lock(work->d_inode); 843 + err = notify_change(work, &attr, NULL); 844 + inode_unlock(work->d_inode); 834 845 if (err) 835 846 goto out_dput; 836 847 } ··· 986 967 return ctr; 987 968 } 988 969 989 - static int ovl_posix_acl_xattr_set(const struct xattr_handler *handler, 990 - struct dentry *dentry, struct inode *inode, 991 - const char *name, const void *value, 992 - size_t size, int flags) 970 + static int __maybe_unused 971 + ovl_posix_acl_xattr_get(const struct xattr_handler *handler, 972 + struct dentry *dentry, struct inode *inode, 973 + const char *name, void *buffer, size_t size) 974 + { 975 + return ovl_xattr_get(dentry, handler->name, buffer, size); 976 + } 977 + 978 + static int __maybe_unused 979 + ovl_posix_acl_xattr_set(const struct xattr_handler *handler, 980 + struct dentry *dentry, struct inode *inode, 981 + const char *name, const void *value, 982 + size_t size, int flags) 993 983 { 994 984 struct dentry *workdir = ovl_workdir(dentry); 995 985 struct inode *realinode = ovl_inode_real(inode, NULL); ··· 1026 998 1027 999 posix_acl_release(acl); 1028 1000 1029 - return ovl_setxattr(dentry, inode, handler->name, value, size, flags); 1001 + err = ovl_xattr_set(dentry, handler->name, value, size, flags); 1002 + if (!err) 1003 + ovl_copyattr(ovl_inode_real(inode, NULL), inode); 1004 + 1005 + return err; 1030 1006 1031 1007 out_acl_release: 1032 1008 posix_acl_release(acl); 1033 1009 return err; 1034 1010 } 1035 1011 1036 - static int ovl_other_xattr_set(const struct xattr_handler *handler, 1037 - struct dentry *dentry, struct inode *inode, 1038 - const char *name, const void *value, 1039 - size_t size, int flags) 1012 + static int ovl_own_xattr_get(const struct xattr_handler *handler, 1013 + struct dentry *dentry, struct inode *inode, 1014 + const char *name, void *buffer, size_t size) 1040 1015 { 1041 - return ovl_setxattr(dentry, inode, name, value, size, flags); 1016 + return -EPERM; 1042 1017 } 1043 1018 1044 1019 static int ovl_own_xattr_set(const struct xattr_handler *handler, ··· 1052 1021 return -EPERM; 1053 1022 } 1054 1023 1055 - static const struct xattr_handler ovl_posix_acl_access_xattr_handler = { 1024 + static int ovl_other_xattr_get(const struct xattr_handler *handler, 1025 + struct dentry *dentry, struct inode *inode, 1026 + const char *name, void *buffer, size_t size) 1027 + { 1028 + return ovl_xattr_get(dentry, name, buffer, size); 1029 + } 1030 + 1031 + static int ovl_other_xattr_set(const struct xattr_handler *handler, 1032 + struct dentry *dentry, struct inode *inode, 1033 + const char *name, const void *value, 1034 + size_t size, int flags) 1035 + { 1036 + return ovl_xattr_set(dentry, name, value, size, flags); 1037 + } 1038 + 1039 + static const struct xattr_handler __maybe_unused 1040 + ovl_posix_acl_access_xattr_handler = { 1056 1041 .name = XATTR_NAME_POSIX_ACL_ACCESS, 1057 1042 .flags = ACL_TYPE_ACCESS, 1043 + .get = ovl_posix_acl_xattr_get, 1058 1044 .set = ovl_posix_acl_xattr_set, 1059 1045 }; 1060 1046 1061 - static const struct xattr_handler ovl_posix_acl_default_xattr_handler = { 1047 + static const struct xattr_handler __maybe_unused 1048 + ovl_posix_acl_default_xattr_handler = { 1062 1049 .name = XATTR_NAME_POSIX_ACL_DEFAULT, 1063 1050 .flags = ACL_TYPE_DEFAULT, 1051 + .get = ovl_posix_acl_xattr_get, 1064 1052 .set = ovl_posix_acl_xattr_set, 1065 1053 }; 1066 1054 1067 1055 static const struct xattr_handler ovl_own_xattr_handler = { 1068 1056 .prefix = OVL_XATTR_PREFIX, 1057 + .get = ovl_own_xattr_get, 1069 1058 .set = ovl_own_xattr_set, 1070 1059 }; 1071 1060 1072 1061 static const struct xattr_handler ovl_other_xattr_handler = { 1073 1062 .prefix = "", /* catch all */ 1063 + .get = ovl_other_xattr_get, 1074 1064 .set = ovl_other_xattr_set, 1075 1065 }; 1076 1066 1077 1067 static const struct xattr_handler *ovl_xattr_handlers[] = { 1068 + #ifdef CONFIG_FS_POSIX_ACL 1078 1069 &ovl_posix_acl_access_xattr_handler, 1079 1070 &ovl_posix_acl_default_xattr_handler, 1071 + #endif 1080 1072 &ovl_own_xattr_handler, 1081 1073 &ovl_other_xattr_handler, 1082 1074 NULL 1083 - }; 1084 - 1085 - static const struct xattr_handler *ovl_xattr_noacl_handlers[] = { 1086 - &ovl_own_xattr_handler, 1087 - &ovl_other_xattr_handler, 1088 - NULL, 1089 1075 }; 1090 1076 1091 1077 static int ovl_fill_super(struct super_block *sb, void *data, int silent) ··· 1180 1132 err = -EINVAL; 1181 1133 stacklen = ovl_split_lowerdirs(lowertmp); 1182 1134 if (stacklen > OVL_MAX_STACK) { 1183 - pr_err("overlayfs: too many lower directries, limit is %d\n", 1135 + pr_err("overlayfs: too many lower directories, limit is %d\n", 1184 1136 OVL_MAX_STACK); 1185 1137 goto out_free_lowertmp; 1186 1138 } else if (!ufs->config.upperdir && stacklen == 1) { ··· 1317 1269 1318 1270 sb->s_magic = OVERLAYFS_SUPER_MAGIC; 1319 1271 sb->s_op = &ovl_super_operations; 1320 - if (IS_ENABLED(CONFIG_FS_POSIX_ACL)) 1321 - sb->s_xattr = ovl_xattr_handlers; 1322 - else 1323 - sb->s_xattr = ovl_xattr_noacl_handlers; 1272 + sb->s_xattr = ovl_xattr_handlers; 1324 1273 sb->s_root = root_dentry; 1325 1274 sb->s_fs_info = ufs; 1326 1275 sb->s_flags |= MS_POSIXACL;
+1
include/linux/fs.h
··· 574 574 575 575 struct posix_acl; 576 576 #define ACL_NOT_CACHED ((void *)(-1)) 577 + #define ACL_DONT_CACHE ((void *)(-3)) 577 578 578 579 static inline struct posix_acl * 579 580 uncached_acl_sentinel(struct task_struct *task)