diff mbox series

[2/6] xfs: always update params on small allocation

Message ID 20190509165839.44329-3-bfoster@redhat.com (mailing list archive)
State Superseded, archived
Headers show
Series xfs: rework extent allocation | expand

Commit Message

Brian Foster May 9, 2019, 4:58 p.m. UTC
xfs_alloc_ag_vextent_small() doesn't update the output parameters in
the event of an AGFL allocation. Instead, it updates the
xfs_alloc_arg structure directly to complete the allocation.

Update both args and the output params to provide consistent
behavior for future callers.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/libxfs/xfs_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig May 10, 2019, 5:26 p.m. UTC | #1
On Thu, May 09, 2019 at 12:58:35PM -0400, Brian Foster wrote:
> xfs_alloc_ag_vextent_small() doesn't update the output parameters in
> the event of an AGFL allocation. Instead, it updates the
> xfs_alloc_arg structure directly to complete the allocation.
> 
> Update both args and the output params to provide consistent
> behavior for future callers.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 55eda416e18b..231e8ca5cce0 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -1637,8 +1637,6 @@  xfs_alloc_ag_vextent_small(
 				}
 				xfs_trans_binval(args->tp, bp);
 			}
-			args->len = 1;
-			args->agbno = fbno;
 			XFS_WANT_CORRUPTED_GOTO(args->mp,
 				args->agbno + args->len <=
 				be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length),
@@ -1656,6 +1654,8 @@  xfs_alloc_ag_vextent_small(
 			if (error)
 				goto error0;
 
+			*fbnop = args->agbno = fbno;
+			*flenp = args->len = 1;
 			*stat = 0;
 			return 0;
 		}