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.

NFSD: Add POSIX ACL file attributes to SUPPATTR bitmasks

Now that infrastructure for NFSv4 POSIX draft ACL has been added
to NFSD, it should be safe to advertise support to NFS clients.

NFSD_SUPPATTR_EXCLCREAT_WORD2 includes NFSv4.2-only attributes,
but version filtering occurs via nfsd_suppattrs[] before this
mask is applied, ensuring pre-4.2 clients never see unsupported
attributes.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+23 -1
+23 -1
fs/nfsd/nfsd.h
··· 454 454 #define NFSD4_2_SECURITY_ATTRS 0 455 455 #endif 456 456 457 + #ifdef CONFIG_NFSD_V4_POSIX_ACLS 458 + #define NFSD4_2_POSIX_ACL_ATTRS \ 459 + (FATTR4_WORD2_ACL_TRUEFORM | \ 460 + FATTR4_WORD2_ACL_TRUEFORM_SCOPE | \ 461 + FATTR4_WORD2_POSIX_DEFAULT_ACL | \ 462 + FATTR4_WORD2_POSIX_ACCESS_ACL) 463 + #else 464 + #define NFSD4_2_POSIX_ACL_ATTRS 0 465 + #endif 466 + 457 467 #define NFSD4_2_SUPPORTED_ATTRS_WORD2 \ 458 468 (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \ 459 469 FATTR4_WORD2_MODE_UMASK | \ ··· 472 462 FATTR4_WORD2_XATTR_SUPPORT | \ 473 463 FATTR4_WORD2_TIME_DELEG_ACCESS | \ 474 464 FATTR4_WORD2_TIME_DELEG_MODIFY | \ 475 - FATTR4_WORD2_OPEN_ARGUMENTS) 465 + FATTR4_WORD2_OPEN_ARGUMENTS | \ 466 + NFSD4_2_POSIX_ACL_ATTRS) 476 467 477 468 extern const u32 nfsd_suppattrs[3][3]; 478 469 ··· 541 530 #else 542 531 #define MAYBE_FATTR4_WORD2_SECURITY_LABEL 0 543 532 #endif 533 + #ifdef CONFIG_NFSD_V4_POSIX_ACLS 534 + #define MAYBE_FATTR4_WORD2_POSIX_ACL_ATTRS \ 535 + FATTR4_WORD2_POSIX_DEFAULT_ACL | FATTR4_WORD2_POSIX_ACCESS_ACL 536 + #else 537 + #define MAYBE_FATTR4_WORD2_POSIX_ACL_ATTRS 0 538 + #endif 544 539 #define NFSD_WRITEABLE_ATTRS_WORD2 \ 545 540 (FATTR4_WORD2_MODE_UMASK \ 546 541 | MAYBE_FATTR4_WORD2_SECURITY_LABEL \ 547 542 | FATTR4_WORD2_TIME_DELEG_ACCESS \ 548 543 | FATTR4_WORD2_TIME_DELEG_MODIFY \ 544 + | MAYBE_FATTR4_WORD2_POSIX_ACL_ATTRS \ 549 545 ) 550 546 551 547 #define NFSD_SUPPATTR_EXCLCREAT_WORD0 \ ··· 568 550 * The FATTR4_WORD2_TIME_DELEG attributes are not to be allowed for 569 551 * OPEN(create) with EXCLUSIVE4_1. It doesn't make sense to set a 570 552 * delegated timestamp on a new file. 553 + * 554 + * This mask includes NFSv4.2-only attributes (e.g., POSIX ACLs). 555 + * Version filtering occurs via nfsd_suppattrs[] before this mask 556 + * is applied, so pre-4.2 clients never see unsupported attributes. 571 557 */ 572 558 #define NFSD_SUPPATTR_EXCLCREAT_WORD2 \ 573 559 (NFSD_WRITEABLE_ATTRS_WORD2 & \