Skip to content

Commit 1fe4fd6

Browse files
committed
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
2 parents b7bfaa7 + 601a27e commit 1fe4fd6

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

fs/xfs/libxfs/xfs_btree.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4666,7 +4666,12 @@ xfs_btree_space_to_height(
46664666
const unsigned int *limits,
46674667
unsigned long long leaf_blocks)
46684668
{
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;
46704675
unsigned long long blocks_left = leaf_blocks - 1;
46714676
unsigned int height = 1;
46724677

fs/xfs/xfs_extent_busy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ xfs_extent_busy_update_extent(
236236
*
237237
*/
238238
busyp->bno = fend;
239+
busyp->length = bend - fend;
239240
} else if (bbno < fbno) {
240241
/*
241242
* Case 8:

fs/xfs/xfs_icache.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,12 +1853,20 @@ xfs_inodegc_worker(
18531853
struct xfs_inodegc, work);
18541854
struct llist_node *node = llist_del_all(&gc->list);
18551855
struct xfs_inode *ip, *n;
1856+
unsigned int nofs_flag;
18561857

18571858
WRITE_ONCE(gc->items, 0);
18581859

18591860
if (!node)
18601861
return;
18611862

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();
1869+
18621870
ip = llist_entry(node, struct xfs_inode, i_gclist);
18631871
trace_xfs_inodegc_worker(ip->i_mount, READ_ONCE(gc->shrinker_hits));
18641872

@@ -1867,6 +1875,8 @@ xfs_inodegc_worker(
18671875
xfs_iflags_set(ip, XFS_INACTIVATING);
18681876
xfs_inodegc_inactivate(ip);
18691877
}
1878+
1879+
memalloc_nofs_restore(nofs_flag);
18701880
}
18711881

18721882
/*

fs/xfs/xfs_ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ xfs_bulkstat_fmt(
754754
static int
755755
xfs_bulk_ireq_setup(
756756
struct xfs_mount *mp,
757-
struct xfs_bulk_ireq *hdr,
757+
const struct xfs_bulk_ireq *hdr,
758758
struct xfs_ibulk *breq,
759759
void __user *ubuffer)
760760
{
@@ -780,7 +780,7 @@ xfs_bulk_ireq_setup(
780780

781781
switch (hdr->ino) {
782782
case XFS_BULK_IREQ_SPECIAL_ROOT:
783-
hdr->ino = mp->m_sb.sb_rootino;
783+
breq->startino = mp->m_sb.sb_rootino;
784784
break;
785785
default:
786786
return -EINVAL;

fs/xfs/xfs_iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ xfs_iomap_valid(
8383
return true;
8484
}
8585

86-
const struct iomap_page_ops xfs_iomap_page_ops = {
86+
static const struct iomap_page_ops xfs_iomap_page_ops = {
8787
.iomap_valid = xfs_iomap_valid,
8888
};
8989

fs/xfs/xfs_qm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ xfs_qm_dquot_walk(
6868

6969
while (1) {
7070
struct xfs_dquot *batch[XFS_DQ_LOOKUP_BATCH];
71-
int error = 0;
71+
int error;
7272
int i;
7373

7474
mutex_lock(&qi->qi_tree_lock);

fs/xfs/xfs_reflink.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,6 @@ xfs_reflink_fill_cow_hole(
416416
goto convert;
417417
}
418418

419-
ASSERT(cmap->br_startoff > imap->br_startoff);
420-
421419
/* Allocate the entire reservation as unwritten blocks. */
422420
nimaps = 1;
423421
error = xfs_bmapi_write(tp, ip, imap->br_startoff, imap->br_blockcount,

0 commit comments

Comments
 (0)