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 tag 'xfs-6.11-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Chandan Babu:

- Fix memory leak when corruption is detected during scrubbing parent
pointers

- Allow SECURE namespace xattrs to use reserved block pool to in order
to prevent ENOSPC

- Save stack space by passing tracepoint's char array to file_path()
instead of another stack variable

- Remove unused parameter in macro XFS_DQUOT_LOGRES

- Replace comma with semicolon in a couple of places

* tag 'xfs-6.11-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: convert comma to semicolon
xfs: convert comma to semicolon
xfs: remove unused parameter in macro XFS_DQUOT_LOGRES
xfs: fix file_path handling in tracepoints
xfs: allow SECURE namespace xattrs to use reserved block pool
xfs: fix a memory leak

+44 -31
+1 -1
fs/xfs/libxfs/xfs_quota_defs.h
··· 56 56 * And, of course, we also need to take into account the dquot log format item 57 57 * used to describe each dquot. 58 58 */ 59 - #define XFS_DQUOT_LOGRES(mp) \ 59 + #define XFS_DQUOT_LOGRES \ 60 60 ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6) 61 61 62 62 #define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
+14 -14
fs/xfs/libxfs/xfs_trans_resv.c
··· 338 338 blksz); 339 339 t1 += adj; 340 340 t3 += adj; 341 - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3); 341 + return XFS_DQUOT_LOGRES + max3(t1, t2, t3); 342 342 } 343 343 344 344 t4 = xfs_calc_refcountbt_reservation(mp, 1); 345 - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3)); 345 + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3)); 346 346 } 347 347 348 348 unsigned int ··· 410 410 xfs_refcountbt_block_count(mp, 4), 411 411 blksz); 412 412 413 - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3); 413 + return XFS_DQUOT_LOGRES + max3(t1, t2, t3); 414 414 } 415 415 416 416 t4 = xfs_calc_refcountbt_reservation(mp, 2); 417 - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3)); 417 + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3)); 418 418 } 419 419 420 420 unsigned int ··· 466 466 xfs_calc_rename_reservation( 467 467 struct xfs_mount *mp) 468 468 { 469 - unsigned int overhead = XFS_DQUOT_LOGRES(mp); 469 + unsigned int overhead = XFS_DQUOT_LOGRES; 470 470 struct xfs_trans_resv *resp = M_RES(mp); 471 471 unsigned int t1, t2, t3 = 0; 472 472 ··· 577 577 xfs_calc_link_reservation( 578 578 struct xfs_mount *mp) 579 579 { 580 - unsigned int overhead = XFS_DQUOT_LOGRES(mp); 580 + unsigned int overhead = XFS_DQUOT_LOGRES; 581 581 struct xfs_trans_resv *resp = M_RES(mp); 582 582 unsigned int t1, t2, t3 = 0; 583 583 ··· 641 641 xfs_calc_remove_reservation( 642 642 struct xfs_mount *mp) 643 643 { 644 - unsigned int overhead = XFS_DQUOT_LOGRES(mp); 644 + unsigned int overhead = XFS_DQUOT_LOGRES; 645 645 struct xfs_trans_resv *resp = M_RES(mp); 646 646 unsigned int t1, t2, t3 = 0; 647 647 ··· 729 729 struct xfs_mount *mp) 730 730 { 731 731 struct xfs_trans_resv *resp = M_RES(mp); 732 - unsigned int overhead = XFS_DQUOT_LOGRES(mp); 732 + unsigned int overhead = XFS_DQUOT_LOGRES; 733 733 unsigned int t1, t2, t3 = 0; 734 734 735 735 t1 = xfs_calc_icreate_resv_alloc(mp); ··· 747 747 xfs_calc_create_tmpfile_reservation( 748 748 struct xfs_mount *mp) 749 749 { 750 - uint res = XFS_DQUOT_LOGRES(mp); 750 + uint res = XFS_DQUOT_LOGRES; 751 751 752 752 res += xfs_calc_icreate_resv_alloc(mp); 753 753 return res + xfs_calc_iunlink_add_reservation(mp); ··· 829 829 xfs_calc_ifree_reservation( 830 830 struct xfs_mount *mp) 831 831 { 832 - return XFS_DQUOT_LOGRES(mp) + 832 + return XFS_DQUOT_LOGRES + 833 833 xfs_calc_inode_res(mp, 1) + 834 834 xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + 835 835 xfs_calc_iunlink_remove_reservation(mp) + ··· 846 846 xfs_calc_ichange_reservation( 847 847 struct xfs_mount *mp) 848 848 { 849 - return XFS_DQUOT_LOGRES(mp) + 849 + return XFS_DQUOT_LOGRES + 850 850 xfs_calc_inode_res(mp, 1) + 851 851 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize); 852 852 ··· 955 955 xfs_calc_addafork_reservation( 956 956 struct xfs_mount *mp) 957 957 { 958 - return XFS_DQUOT_LOGRES(mp) + 958 + return XFS_DQUOT_LOGRES + 959 959 xfs_calc_inode_res(mp, 1) + 960 960 xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + 961 961 xfs_calc_buf_res(1, mp->m_dir_geo->blksize) + ··· 1003 1003 xfs_calc_attrsetm_reservation( 1004 1004 struct xfs_mount *mp) 1005 1005 { 1006 - return XFS_DQUOT_LOGRES(mp) + 1006 + return XFS_DQUOT_LOGRES + 1007 1007 xfs_calc_inode_res(mp, 1) + 1008 1008 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) + 1009 1009 xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1)); ··· 1043 1043 xfs_calc_attrrm_reservation( 1044 1044 struct xfs_mount *mp) 1045 1045 { 1046 - return XFS_DQUOT_LOGRES(mp) + 1046 + return XFS_DQUOT_LOGRES + 1047 1047 max((xfs_calc_inode_res(mp, 1) + 1048 1048 xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, 1049 1049 XFS_FSB_TO_B(mp, 1)) +
+1 -1
fs/xfs/scrub/agheader_repair.c
··· 696 696 * step. 697 697 */ 698 698 xagb_bitmap_init(&af.used_extents); 699 - af.agfl_bno = xfs_buf_to_agfl_bno(agfl_bp), 699 + af.agfl_bno = xfs_buf_to_agfl_bno(agfl_bp); 700 700 xagb_bitmap_walk(agfl_extents, xrep_agfl_fill, &af); 701 701 error = xagb_bitmap_disunion(agfl_extents, &af.used_extents); 702 702 if (error)
+1 -1
fs/xfs/scrub/parent.c
··· 799 799 } 800 800 801 801 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) 802 - goto out_pp; 802 + goto out_names; 803 803 804 804 /* 805 805 * Complain if the number of parent pointers doesn't match the link
+4 -6
fs/xfs/scrub/trace.h
··· 959 959 TP_STRUCT__entry( 960 960 __field(dev_t, dev) 961 961 __field(unsigned long, ino) 962 - __array(char, pathname, 256) 962 + __array(char, pathname, MAXNAMELEN) 963 963 ), 964 964 TP_fast_assign( 965 - char pathname[257]; 966 965 char *path; 967 966 968 967 __entry->ino = file_inode(xf->file)->i_ino; 969 - memset(pathname, 0, sizeof(pathname)); 970 - path = file_path(xf->file, pathname, sizeof(pathname) - 1); 968 + path = file_path(xf->file, __entry->pathname, MAXNAMELEN); 971 969 if (IS_ERR(path)) 972 - path = "(unknown)"; 973 - strncpy(__entry->pathname, path, sizeof(__entry->pathname)); 970 + strncpy(__entry->pathname, "(unknown)", 971 + sizeof(__entry->pathname)); 974 972 ), 975 973 TP_printk("xfino 0x%lx path '%s'", 976 974 __entry->ino,
+1 -1
fs/xfs/xfs_attr_list.c
··· 139 139 sbp->name = sfe->nameval; 140 140 sbp->namelen = sfe->namelen; 141 141 /* These are bytes, and both on-disk, don't endian-flip */ 142 - sbp->value = &sfe->nameval[sfe->namelen], 142 + sbp->value = &sfe->nameval[sfe->namelen]; 143 143 sbp->valuelen = sfe->valuelen; 144 144 sbp->flags = sfe->flags; 145 145 sbp->hash = xfs_attr_hashval(dp->i_mount, sfe->flags,
+4 -6
fs/xfs/xfs_trace.h
··· 4715 4715 TP_STRUCT__entry( 4716 4716 __field(dev_t, dev) 4717 4717 __field(unsigned long, ino) 4718 - __array(char, pathname, 256) 4718 + __array(char, pathname, MAXNAMELEN) 4719 4719 ), 4720 4720 TP_fast_assign( 4721 - char pathname[257]; 4722 4721 char *path; 4723 4722 struct file *file = btp->bt_file; 4724 4723 4725 4724 __entry->dev = btp->bt_mount->m_super->s_dev; 4726 4725 __entry->ino = file_inode(file)->i_ino; 4727 - memset(pathname, 0, sizeof(pathname)); 4728 - path = file_path(file, pathname, sizeof(pathname) - 1); 4726 + path = file_path(file, __entry->pathname, MAXNAMELEN); 4729 4727 if (IS_ERR(path)) 4730 - path = "(unknown)"; 4731 - strncpy(__entry->pathname, path, sizeof(__entry->pathname)); 4728 + strncpy(__entry->pathname, "(unknown)", 4729 + sizeof(__entry->pathname)); 4732 4730 ), 4733 4731 TP_printk("dev %d:%d xmino 0x%lx path '%s'", 4734 4732 MAJOR(__entry->dev), MINOR(__entry->dev),
+18 -1
fs/xfs/xfs_xattr.c
··· 110 110 args->whichfork = XFS_ATTR_FORK; 111 111 xfs_attr_sethash(args); 112 112 113 - return xfs_attr_set(args, op, args->attr_filter & XFS_ATTR_ROOT); 113 + /* 114 + * Some xattrs must be resistant to allocation failure at ENOSPC, e.g. 115 + * creating an inode with ACLs or security attributes requires the 116 + * allocation of the xattr holding that information to succeed. Hence 117 + * we allow xattrs in the VFS TRUSTED, SYSTEM, POSIX_ACL and SECURITY 118 + * (LSM xattr) namespaces to dip into the reserve block pool to allow 119 + * manipulation of these xattrs when at ENOSPC. These VFS xattr 120 + * namespaces translate to the XFS_ATTR_ROOT and XFS_ATTR_SECURE on-disk 121 + * namespaces. 122 + * 123 + * For most of these cases, these special xattrs will fit in the inode 124 + * itself and so consume no extra space or only require temporary extra 125 + * space while an overwrite is being made. Hence the use of the reserved 126 + * pool is largely to avoid the worst case reservation from preventing 127 + * the xattr from being created at ENOSPC. 128 + */ 129 + return xfs_attr_set(args, op, 130 + args->attr_filter & (XFS_ATTR_ROOT | XFS_ATTR_SECURE)); 114 131 } 115 132 116 133