diff mbox

[05/47] xfs: set *stat=1 after iroot realloc

Message ID 146907699326.25461.8018421055879226973.stgit@birch.djwong.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Darrick J. Wong July 21, 2016, 4:56 a.m. UTC
If we make the inode root block of a btree unfull by expanding the
root, we must set *stat to 1 to signal success, rather than leaving
it uninitialized.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_btree.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Brian Foster July 26, 2016, 4:36 p.m. UTC | #1
On Wed, Jul 20, 2016 at 09:56:33PM -0700, Darrick J. Wong wrote:
> If we make the inode root block of a btree unfull by expanding the
> root, we must set *stat to 1 to signal success, rather than leaving
> it uninitialized.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_btree.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 07eeb0b..f5ff95a 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -2871,6 +2871,7 @@ xfs_btree_make_block_unfull(
>  		if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) {
>  			/* A root block that can be made bigger. */
>  			xfs_iroot_realloc(ip, 1, cur->bc_private.b.whichfork);
> +			*stat = 1;
>  		} else {
>  			/* A root block that needs replacing */
>  			int	logflags = 0;
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
Christoph Hellwig Aug. 1, 2016, 6:35 a.m. UTC | #2
On Wed, Jul 20, 2016 at 09:56:33PM -0700, Darrick J. Wong wrote:
> If we make the inode root block of a btree unfull by expanding the
> root, we must set *stat to 1 to signal success, rather than leaving
> it uninitialized.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks fine,

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

Patch

diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 07eeb0b..f5ff95a 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -2871,6 +2871,7 @@  xfs_btree_make_block_unfull(
 		if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) {
 			/* A root block that can be made bigger. */
 			xfs_iroot_realloc(ip, 1, cur->bc_private.b.whichfork);
+			*stat = 1;
 		} else {
 			/* A root block that needs replacing */
 			int	logflags = 0;