]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
libxfs: don't barf in libxfs_bwrite on a null buffer ops name
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 13 Mar 2020 20:46:33 +0000 (13:46 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 Apr 2020 18:40:51 +0000 (11:40 -0700)
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@oracle.com>
libxfs/rdwr.c

index 3c43a4d0dab5c91d61fe324fda5f3c1a8fec438a..8a6902699026f9147414ef0cc06d0267a11ad8e3 100644 (file)
@@ -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;