diff mbox series

xfs_db: set b_ops to NULL in set_cur for types without verifiers

Message ID 06cdcef6-2f44-c702-198b-4ae53052ec28@redhat.com (mailing list archive)
State Accepted
Headers show
Series xfs_db: set b_ops to NULL in set_cur for types without verifiers | expand

Commit Message

Eric Sandeen Aug. 27, 2020, 4:53 p.m. UTC
If we are using set_cur() to set a type that has no verifier ops,
be sure to set b_ops to NULL so that the old verifiers don't run
against the buffer anymore, which may have changed size.

Fixes: cdabe556 ("xfs_db: consolidate set_iocur_type behavior")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Comments

Darrick J. Wong Aug. 27, 2020, 5:22 p.m. UTC | #1
On Thu, Aug 27, 2020 at 11:53:33AM -0500, Eric Sandeen wrote:
> If we are using set_cur() to set a type that has no verifier ops,
> be sure to set b_ops to NULL so that the old verifiers don't run
> against the buffer anymore, which may have changed size.
> 
> Fixes: cdabe556 ("xfs_db: consolidate set_iocur_type behavior")
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Seems to fix the xfs/070 regression, thanks.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
> 
> diff --git a/db/io.c b/db/io.c
> index 9309f361..c79cf105 100644
> --- a/db/io.c
> +++ b/db/io.c
> @@ -561,8 +561,10 @@ set_cur(
>  		return;
>  	iocur_top->buf = bp->b_addr;
>  	iocur_top->bp = bp;
> -	if (!ops)
> +	if (!ops) {
> +		bp->b_ops = NULL;
>  		bp->b_flags |= LIBXFS_B_UNCHECKED;
> +	}
>  
>  	iocur_top->bb = blknum;
>  	iocur_top->blen = len;
>
diff mbox series

Patch

diff --git a/db/io.c b/db/io.c
index 9309f361..c79cf105 100644
--- a/db/io.c
+++ b/db/io.c
@@ -561,8 +561,10 @@  set_cur(
 		return;
 	iocur_top->buf = bp->b_addr;
 	iocur_top->bp = bp;
-	if (!ops)
+	if (!ops) {
+		bp->b_ops = NULL;
 		bp->b_flags |= LIBXFS_B_UNCHECKED;
+	}
 
 	iocur_top->bb = blknum;
 	iocur_top->blen = len;