Message ID | 20200508105559.27037-1-bfoster@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | xfs: fix unused variable warning in buffer completion on !DEBUG | expand |
On Fri, May 08, 2020 at 06:55:59AM -0400, Brian Foster wrote: > The random buffer write failure errortag patch introduced a local > mount pointer variable for the test macro, but the macro is compiled > out on !DEBUG kernels. This results in an unused variable warning. > > Access the mount structure through the buffer pointer and remove the > local mount pointer to address the warning. > > Fixes: 7376d745473 ("xfs: random buffer write failure errortag") > Signed-off-by: Brian Foster <bfoster@redhat.com> Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
On Fri, May 08, 2020 at 06:55:59AM -0400, Brian Foster wrote: > The random buffer write failure errortag patch introduced a local > mount pointer variable for the test macro, but the macro is compiled > out on !DEBUG kernels. This results in an unused variable warning. > > Access the mount structure through the buffer pointer and remove the > local mount pointer to address the warning. > > Fixes: 7376d745473 ("xfs: random buffer write failure errortag") > Signed-off-by: Brian Foster <bfoster@redhat.com> Looks ok, Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > --- > > Feel free to fold this into the original commit or merge independently. > Sorry for the noise.. > > Brian > > fs/xfs/xfs_buf.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c > index 9d8841ac7375..9c2fbb6bbf89 100644 > --- a/fs/xfs/xfs_buf.c > +++ b/fs/xfs/xfs_buf.c > @@ -1289,11 +1289,10 @@ xfs_buf_bio_end_io( > struct bio *bio) > { > struct xfs_buf *bp = (struct xfs_buf *)bio->bi_private; > - struct xfs_mount *mp = bp->b_mount; > > if (!bio->bi_status && > (bp->b_flags & XBF_WRITE) && (bp->b_flags & XBF_ASYNC) && > - XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BUF_IOERROR)) > + XFS_TEST_ERROR(false, bp->b_mount, XFS_ERRTAG_BUF_IOERROR)) > bio->bi_status = BLK_STS_IOERR; > > /* > -- > 2.21.1 >
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 9d8841ac7375..9c2fbb6bbf89 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1289,11 +1289,10 @@ xfs_buf_bio_end_io( struct bio *bio) { struct xfs_buf *bp = (struct xfs_buf *)bio->bi_private; - struct xfs_mount *mp = bp->b_mount; if (!bio->bi_status && (bp->b_flags & XBF_WRITE) && (bp->b_flags & XBF_ASYNC) && - XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BUF_IOERROR)) + XFS_TEST_ERROR(false, bp->b_mount, XFS_ERRTAG_BUF_IOERROR)) bio->bi_status = BLK_STS_IOERR; /*
The random buffer write failure errortag patch introduced a local mount pointer variable for the test macro, but the macro is compiled out on !DEBUG kernels. This results in an unused variable warning. Access the mount structure through the buffer pointer and remove the local mount pointer to address the warning. Fixes: 7376d745473 ("xfs: random buffer write failure errortag") Signed-off-by: Brian Foster <bfoster@redhat.com> --- Feel free to fold this into the original commit or merge independently. Sorry for the noise.. Brian fs/xfs/xfs_buf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)