Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a3e18a5

Browse files
committed
Merge tag 'xfs-6.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fix from Chandan Babu: "Ensure xfs incore superblock's allocated inode counter, free inode counter, and free data block counter are all zero or positive when they are copied over from xfs_mount->m_[icount,ifree,fdblocks] respectively" * tag 'xfs-6.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: make sure sb_fdblocks is non-negative
2 parents 62e1f3b + 58f8807 commit a3e18a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/xfs/libxfs/xfs_sb.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,11 +1038,12 @@ xfs_log_sb(
10381038
* and hence we don't need have to update it here.
10391039
*/
10401040
if (xfs_has_lazysbcount(mp)) {
1041-
mp->m_sb.sb_icount = percpu_counter_sum(&mp->m_icount);
1041+
mp->m_sb.sb_icount = percpu_counter_sum_positive(&mp->m_icount);
10421042
mp->m_sb.sb_ifree = min_t(uint64_t,
1043-
percpu_counter_sum(&mp->m_ifree),
1043+
percpu_counter_sum_positive(&mp->m_ifree),
10441044
mp->m_sb.sb_icount);
1045-
mp->m_sb.sb_fdblocks = percpu_counter_sum(&mp->m_fdblocks);
1045+
mp->m_sb.sb_fdblocks =
1046+
percpu_counter_sum_positive(&mp->m_fdblocks);
10461047
}
10471048

10481049
xfs_sb_to_disk(bp->b_addr, &mp->m_sb);

0 commit comments

Comments
 (0)