Skip to contentSkip to conversation

linux-next: build warning after merge of the xfs tree

PATCH In review Stephen Rothwell 4 participants 4 messages May 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the xfs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

fs/xfs/xfs_buf.c: In function 'xfs_buf_bio_end_io':
fs/xfs/xfs_buf.c:1292:20: warning: unused variable 'mp' [-Wunused-variable]
1292 | struct xfs_mount *mp = bp->b_mount;
| ^~

Introduced by commit

7376d7454734 ("xfs: random buffer write failure errortag")

DEBUG is not defined.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

PATCH 1/1 xfs: fix unused variable warning in buffer completion on !DEBUG

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")

---

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(-)
fs/xfs/xfs_buf.c +1 -2
index 9d8841ac7375..9c2fbb6bbf89 100644
@@ -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;
 
 	/*
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] xfs: fix unused variable warning in buffer completion on !DEBUG

Quoted 9 lines · Brian Foster

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")

Looks good:

Reviewed-by on v1 1/1
#3 lore raw

Re: [PATCH] xfs: fix unused variable warning in buffer completion on !DEBUG

In reply to Brian Foster
Quoted 9 lines · Brian Foster

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")

Looks ok,

--D

Quoted 30 lines

---

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(-)
fs/xfs/xfs_buf.c +1 -2
index 9d8841ac7375..9c2fbb6bbf89 100644
@@ -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;
 
 	/*
Signature · 1 line
2.21.1