Re: [PATCH 1/5] libxfs: don't barf in libxfs_bwrite on a null buffer ops name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/6/20 11:52 AM, Darrick J. Wong wrote:
From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Don't crash if we failed to write a buffer that had no buffer verifier.
This should be rare in practice, but coverity found a valid bug.

Coverity-id: 1460462
Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
Looks ok:
Reviewed-by: Allison Collins <allison.henderson@xxxxxxxxxx>

---
  libxfs/rdwr.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 3c43a4d0..8a690269 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -1028,7 +1028,7 @@ libxfs_bwrite(
  	if (bp->b_error) {
  		fprintf(stderr,
  	_("%s: write failed on %s bno 0x%llx/0x%x, err=%d\n"),
-			__func__, bp->b_ops->name,
+			__func__, bp->b_ops ? bp->b_ops->name : "(unknown)",
  			(long long)bp->b_bn, bp->b_bcount, -bp->b_error);
  	} else {
  		bp->b_flags |= LIBXFS_B_UPTODATE;




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux