xfs: don't fail xfs_extent_busy allocation
authorChristoph Hellwig <hch@lst.de>
Tue, 7 Feb 2017 22:06:46 +0000 (14:06 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 9 Feb 2017 18:50:25 +0000 (10:50 -0800)
We don't just need the structure to track busy extents which can be
avoided with a synchronous transaction, but also to keep track of
pending discard.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_extent_busy.c

index 162dc18..29c2f99 100644 (file)
@@ -45,18 +45,7 @@ xfs_extent_busy_insert(
        struct rb_node          **rbp;
        struct rb_node          *parent = NULL;
 
-       new = kmem_zalloc(sizeof(struct xfs_extent_busy), KM_MAYFAIL);
-       if (!new) {
-               /*
-                * No Memory!  Since it is now not possible to track the free
-                * block, make this a synchronous transaction to insure that
-                * the block is not reused before this transaction commits.
-                */
-               trace_xfs_extent_busy_enomem(tp->t_mountp, agno, bno, len);
-               xfs_trans_set_sync(tp);
-               return;
-       }
-
+       new = kmem_zalloc(sizeof(struct xfs_extent_busy), KM_SLEEP);
        new->agno = agno;
        new->bno = bno;
        new->length = len;