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

Merge tag 'xfs-6.2-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:

- Remove some incorrect assertions

- Fix compiler warnings about variables that could be static

- Fix an off by one error when computing the maximum btree height that
can cause repair failures

- Fix the bulkstat-single ioctl not returning the root inode when asked
to do that

- Convey NOFS state to inodegc workers to avoid recursion in reclaim

- Fix unnecessary variable initializations

- Fix a bug that could result in corruption of the busy extent tree

* tag 'xfs-6.2-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: fix extent busy updating
xfs: xfs_qm: remove unnecessary ‘0’ values from error
xfs: Fix deadlock on xfs_inodegc_worker
xfs: get root inode correctly at bulkstat
xfs: fix off-by-one error in xfs_btree_space_to_height
xfs: make xfs_iomap_page_ops static
xfs: don't assert if cmap covers imap after cycling lock

+21 -7
+6 -1
fs/xfs/libxfs/xfs_btree.c
··· 4666 4666 const unsigned int *limits, 4667 4667 unsigned long long leaf_blocks) 4668 4668 { 4669 - unsigned long long node_blocks = limits[1]; 4669 + /* 4670 + * The root btree block can have fewer than minrecs pointers in it 4671 + * because the tree might not be big enough to require that amount of 4672 + * fanout. Hence it has a minimum size of 2 pointers, not limits[1]. 4673 + */ 4674 + unsigned long long node_blocks = 2; 4670 4675 unsigned long long blocks_left = leaf_blocks - 1; 4671 4676 unsigned int height = 1; 4672 4677
+1
fs/xfs/xfs_extent_busy.c
··· 236 236 * 237 237 */ 238 238 busyp->bno = fend; 239 + busyp->length = bend - fend; 239 240 } else if (bbno < fbno) { 240 241 /* 241 242 * Case 8:
+10
fs/xfs/xfs_icache.c
··· 1853 1853 struct xfs_inodegc, work); 1854 1854 struct llist_node *node = llist_del_all(&gc->list); 1855 1855 struct xfs_inode *ip, *n; 1856 + unsigned int nofs_flag; 1856 1857 1857 1858 WRITE_ONCE(gc->items, 0); 1858 1859 1859 1860 if (!node) 1860 1861 return; 1862 + 1863 + /* 1864 + * We can allocate memory here while doing writeback on behalf of 1865 + * memory reclaim. To avoid memory allocation deadlocks set the 1866 + * task-wide nofs context for the following operations. 1867 + */ 1868 + nofs_flag = memalloc_nofs_save(); 1861 1869 1862 1870 ip = llist_entry(node, struct xfs_inode, i_gclist); 1863 1871 trace_xfs_inodegc_worker(ip->i_mount, READ_ONCE(gc->shrinker_hits)); ··· 1875 1867 xfs_iflags_set(ip, XFS_INACTIVATING); 1876 1868 xfs_inodegc_inactivate(ip); 1877 1869 } 1870 + 1871 + memalloc_nofs_restore(nofs_flag); 1878 1872 } 1879 1873 1880 1874 /*
+2 -2
fs/xfs/xfs_ioctl.c
··· 754 754 static int 755 755 xfs_bulk_ireq_setup( 756 756 struct xfs_mount *mp, 757 - struct xfs_bulk_ireq *hdr, 757 + const struct xfs_bulk_ireq *hdr, 758 758 struct xfs_ibulk *breq, 759 759 void __user *ubuffer) 760 760 { ··· 780 780 781 781 switch (hdr->ino) { 782 782 case XFS_BULK_IREQ_SPECIAL_ROOT: 783 - hdr->ino = mp->m_sb.sb_rootino; 783 + breq->startino = mp->m_sb.sb_rootino; 784 784 break; 785 785 default: 786 786 return -EINVAL;
+1 -1
fs/xfs/xfs_iomap.c
··· 83 83 return true; 84 84 } 85 85 86 - const struct iomap_page_ops xfs_iomap_page_ops = { 86 + static const struct iomap_page_ops xfs_iomap_page_ops = { 87 87 .iomap_valid = xfs_iomap_valid, 88 88 }; 89 89
+1 -1
fs/xfs/xfs_qm.c
··· 68 68 69 69 while (1) { 70 70 struct xfs_dquot *batch[XFS_DQ_LOOKUP_BATCH]; 71 - int error = 0; 71 + int error; 72 72 int i; 73 73 74 74 mutex_lock(&qi->qi_tree_lock);
-2
fs/xfs/xfs_reflink.c
··· 416 416 goto convert; 417 417 } 418 418 419 - ASSERT(cmap->br_startoff > imap->br_startoff); 420 - 421 419 /* Allocate the entire reservation as unwritten blocks. */ 422 420 nimaps = 1; 423 421 error = xfs_bmapi_write(tp, ip, imap->br_startoff, imap->br_blockcount,