aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-02-16 20:12:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 03:30:32 -0400
commita2402936943364e39ef5833db29387d019182ce7 (patch)
treea9b825f7043744192d544267d5980cf99addf247 /fs
parent9559c48c1a7d547a1c0aa369f2aaf6325aa805bb (diff)
xfs: tune down agno asserts in the bmap code
commit 410d17f67e583559be3a922f8b6cc336331893f3 upstream. In various places we currently assert that xfs_bmap_btalloc allocates from the same as the firstblock value passed in, unless it's either NULLAGNO or the dop_low flag is set. But the reflink code does not fully follow this convention as it passes in firstblock purely as a hint for the allocator without actually having previous allocations in the transaction, and without having a minleft check on the current AG, leading to the assert firing on a very full and heavily used file system. As even the reflink code only allocates from equal or higher AGs for now we can simply the check to always allow for equal or higher AGs. Note that we need to eventually split the two meanings of the firstblock value. At that point we can also allow the reflink code to allocate from any AG instead of limiting it in any way. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 70e732ce3dea..a4322526ea5f 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -804,9 +804,7 @@ try_another_ag:
804 */ 804 */
805 ASSERT(args.fsbno != NULLFSBLOCK); 805 ASSERT(args.fsbno != NULLFSBLOCK);
806 ASSERT(*firstblock == NULLFSBLOCK || 806 ASSERT(*firstblock == NULLFSBLOCK ||
807 args.agno == XFS_FSB_TO_AGNO(mp, *firstblock) || 807 args.agno >= XFS_FSB_TO_AGNO(mp, *firstblock));
808 (dfops->dop_low &&
809 args.agno > XFS_FSB_TO_AGNO(mp, *firstblock)));
810 *firstblock = cur->bc_private.b.firstblock = args.fsbno; 808 *firstblock = cur->bc_private.b.firstblock = args.fsbno;
811 cur->bc_private.b.allocated++; 809 cur->bc_private.b.allocated++;
812 ip->i_d.di_nblocks++; 810 ip->i_d.di_nblocks++;
@@ -3923,17 +3921,13 @@ xfs_bmap_btalloc(
3923 * the first block that was allocated. 3921 * the first block that was allocated.
3924 */ 3922 */
3925 ASSERT(*ap->firstblock == NULLFSBLOCK || 3923 ASSERT(*ap->firstblock == NULLFSBLOCK ||
3926 XFS_FSB_TO_AGNO(mp, *ap->firstblock) == 3924 XFS_FSB_TO_AGNO(mp, *ap->firstblock) <=
3927 XFS_FSB_TO_AGNO(mp, args.fsbno) || 3925 XFS_FSB_TO_AGNO(mp, args.fsbno));
3928 (ap->dfops->dop_low &&
3929 XFS_FSB_TO_AGNO(mp, *ap->firstblock) <
3930 XFS_FSB_TO_AGNO(mp, args.fsbno)));
3931 3926
3932 ap->blkno = args.fsbno; 3927 ap->blkno = args.fsbno;
3933 if (*ap->firstblock == NULLFSBLOCK) 3928 if (*ap->firstblock == NULLFSBLOCK)
3934 *ap->firstblock = args.fsbno; 3929 *ap->firstblock = args.fsbno;
3935 ASSERT(nullfb || fb_agno == args.agno || 3930 ASSERT(nullfb || fb_agno <= args.agno);
3936 (ap->dfops->dop_low && fb_agno < args.agno));
3937 ap->length = args.len; 3931 ap->length = args.len;
3938 if (!(ap->flags & XFS_BMAPI_COWFORK)) 3932 if (!(ap->flags & XFS_BMAPI_COWFORK))
3939 ap->ip->i_d.di_nblocks += args.len; 3933 ap->ip->i_d.di_nblocks += args.len;
@@ -4858,13 +4852,9 @@ error0:
4858 if (bma.cur) { 4852 if (bma.cur) {
4859 if (!error) { 4853 if (!error) {
4860 ASSERT(*firstblock == NULLFSBLOCK || 4854 ASSERT(*firstblock == NULLFSBLOCK ||
4861 XFS_FSB_TO_AGNO(mp, *firstblock) == 4855 XFS_FSB_TO_AGNO(mp, *firstblock) <=
4862 XFS_FSB_TO_AGNO(mp, 4856 XFS_FSB_TO_AGNO(mp,
4863 bma.cur->bc_private.b.firstblock) || 4857 bma.cur->bc_private.b.firstblock));
4864 (dfops->dop_low &&
4865 XFS_FSB_TO_AGNO(mp, *firstblock) <
4866 XFS_FSB_TO_AGNO(mp,
4867 bma.cur->bc_private.b.firstblock)));
4868 *firstblock = bma.cur->bc_private.b.firstblock; 4858 *firstblock = bma.cur->bc_private.b.firstblock;
4869 } 4859 }
4870 xfs_btree_del_cursor(bma.cur, 4860 xfs_btree_del_cursor(bma.cur,