libxfs: don't barf in libxfs_bwrite on a null buffer ops name

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 <>
Reviewed-by: Allison Collins <>
Signed-off-by: Eric Sandeen <>

diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 3c43a4d..8a69026 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -1028,7 +1028,7 @@
 	if (bp->b_error) {
 	_("%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;