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

Merge tag 'nfsd-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:

- Fix a potential tracepoint crash

- Fix NFSv4 GETATTR on big-endian platforms

* tag 'nfsd-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
NFSD: fix endianness issue in nfsd4_encode_fattr4
SUNRPC: Fix rpcgss_context trace event acceptor field

+25 -26
+23 -24
fs/nfsd/nfs4xdr.c
··· 3490 3490 struct dentry *dentry, const u32 *bmval, 3491 3491 int ignore_crossmnt) 3492 3492 { 3493 + DECLARE_BITMAP(attr_bitmap, ARRAY_SIZE(nfsd4_enc_fattr4_encode_ops)); 3493 3494 struct nfsd4_fattr_args args; 3494 3495 struct svc_fh *tempfh = NULL; 3495 3496 int starting_len = xdr->buf->len; 3496 3497 __be32 *attrlen_p, status; 3497 3498 int attrlen_offset; 3499 + u32 attrmask[3]; 3498 3500 int err; 3499 3501 struct nfsd4_compoundres *resp = rqstp->rq_resp; 3500 3502 u32 minorversion = resp->cstate.minorversion; ··· 3504 3502 .mnt = exp->ex_path.mnt, 3505 3503 .dentry = dentry, 3506 3504 }; 3507 - union { 3508 - u32 attrmask[3]; 3509 - unsigned long mask[2]; 3510 - } u; 3511 3505 unsigned long bit; 3512 3506 bool file_modified = false; 3513 3507 u64 size = 0; ··· 3519 3521 /* 3520 3522 * Make a local copy of the attribute bitmap that can be modified. 3521 3523 */ 3522 - memset(&u, 0, sizeof(u)); 3523 - u.attrmask[0] = bmval[0]; 3524 - u.attrmask[1] = bmval[1]; 3525 - u.attrmask[2] = bmval[2]; 3524 + attrmask[0] = bmval[0]; 3525 + attrmask[1] = bmval[1]; 3526 + attrmask[2] = bmval[2]; 3526 3527 3527 3528 args.rdattr_err = 0; 3528 3529 if (exp->ex_fslocs.migrated) { 3529 - status = fattr_handle_absent_fs(&u.attrmask[0], &u.attrmask[1], 3530 - &u.attrmask[2], &args.rdattr_err); 3530 + status = fattr_handle_absent_fs(&attrmask[0], &attrmask[1], 3531 + &attrmask[2], &args.rdattr_err); 3531 3532 if (status) 3532 3533 goto out; 3533 3534 } 3534 3535 args.size = 0; 3535 - if (u.attrmask[0] & (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE)) { 3536 + if (attrmask[0] & (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE)) { 3536 3537 status = nfsd4_deleg_getattr_conflict(rqstp, d_inode(dentry), 3537 3538 &file_modified, &size); 3538 3539 if (status) ··· 3550 3553 3551 3554 if (!(args.stat.result_mask & STATX_BTIME)) 3552 3555 /* underlying FS does not offer btime so we can't share it */ 3553 - u.attrmask[1] &= ~FATTR4_WORD1_TIME_CREATE; 3554 - if ((u.attrmask[0] & (FATTR4_WORD0_FILES_AVAIL | FATTR4_WORD0_FILES_FREE | 3556 + attrmask[1] &= ~FATTR4_WORD1_TIME_CREATE; 3557 + if ((attrmask[0] & (FATTR4_WORD0_FILES_AVAIL | FATTR4_WORD0_FILES_FREE | 3555 3558 FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_MAXNAME)) || 3556 - (u.attrmask[1] & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | 3559 + (attrmask[1] & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | 3557 3560 FATTR4_WORD1_SPACE_TOTAL))) { 3558 3561 err = vfs_statfs(&path, &args.statfs); 3559 3562 if (err) 3560 3563 goto out_nfserr; 3561 3564 } 3562 - if ((u.attrmask[0] & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && 3565 + if ((attrmask[0] & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && 3563 3566 !fhp) { 3564 3567 tempfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL); 3565 3568 status = nfserr_jukebox; ··· 3574 3577 args.fhp = fhp; 3575 3578 3576 3579 args.acl = NULL; 3577 - if (u.attrmask[0] & FATTR4_WORD0_ACL) { 3580 + if (attrmask[0] & FATTR4_WORD0_ACL) { 3578 3581 err = nfsd4_get_nfs4_acl(rqstp, dentry, &args.acl); 3579 3582 if (err == -EOPNOTSUPP) 3580 - u.attrmask[0] &= ~FATTR4_WORD0_ACL; 3583 + attrmask[0] &= ~FATTR4_WORD0_ACL; 3581 3584 else if (err == -EINVAL) { 3582 3585 status = nfserr_attrnotsupp; 3583 3586 goto out; ··· 3589 3592 3590 3593 #ifdef CONFIG_NFSD_V4_SECURITY_LABEL 3591 3594 args.context = NULL; 3592 - if ((u.attrmask[2] & FATTR4_WORD2_SECURITY_LABEL) || 3593 - u.attrmask[0] & FATTR4_WORD0_SUPPORTED_ATTRS) { 3595 + if ((attrmask[2] & FATTR4_WORD2_SECURITY_LABEL) || 3596 + attrmask[0] & FATTR4_WORD0_SUPPORTED_ATTRS) { 3594 3597 if (exp->ex_flags & NFSEXP_SECURITY_LABEL) 3595 3598 err = security_inode_getsecctx(d_inode(dentry), 3596 3599 &args.context, &args.contextlen); 3597 3600 else 3598 3601 err = -EOPNOTSUPP; 3599 3602 args.contextsupport = (err == 0); 3600 - if (u.attrmask[2] & FATTR4_WORD2_SECURITY_LABEL) { 3603 + if (attrmask[2] & FATTR4_WORD2_SECURITY_LABEL) { 3601 3604 if (err == -EOPNOTSUPP) 3602 - u.attrmask[2] &= ~FATTR4_WORD2_SECURITY_LABEL; 3605 + attrmask[2] &= ~FATTR4_WORD2_SECURITY_LABEL; 3603 3606 else if (err) 3604 3607 goto out_nfserr; 3605 3608 } ··· 3607 3610 #endif /* CONFIG_NFSD_V4_SECURITY_LABEL */ 3608 3611 3609 3612 /* attrmask */ 3610 - status = nfsd4_encode_bitmap4(xdr, u.attrmask[0], 3611 - u.attrmask[1], u.attrmask[2]); 3613 + status = nfsd4_encode_bitmap4(xdr, attrmask[0], attrmask[1], 3614 + attrmask[2]); 3612 3615 if (status) 3613 3616 goto out; 3614 3617 ··· 3617 3620 attrlen_p = xdr_reserve_space(xdr, XDR_UNIT); 3618 3621 if (!attrlen_p) 3619 3622 goto out_resource; 3620 - for_each_set_bit(bit, (const unsigned long *)&u.mask, 3623 + bitmap_from_arr32(attr_bitmap, attrmask, 3624 + ARRAY_SIZE(nfsd4_enc_fattr4_encode_ops)); 3625 + for_each_set_bit(bit, attr_bitmap, 3621 3626 ARRAY_SIZE(nfsd4_enc_fattr4_encode_ops)) { 3622 3627 status = nfsd4_enc_fattr4_encode_ops[bit](xdr, &args); 3623 3628 if (status != nfs_ok)
+2 -2
include/trace/events/rpcgss.h
··· 609 609 __field(unsigned int, timeout) 610 610 __field(u32, window_size) 611 611 __field(int, len) 612 - __string(acceptor, data) 612 + __string_len(acceptor, data, len) 613 613 ), 614 614 615 615 TP_fast_assign( ··· 618 618 __entry->timeout = timeout; 619 619 __entry->window_size = window_size; 620 620 __entry->len = len; 621 - strncpy(__get_str(acceptor), data, len); 621 + __assign_str(acceptor, data); 622 622 ), 623 623 624 624 TP_printk("win_size=%u expiry=%lu now=%lu timeout=%u acceptor=%.*s",