From b9d447d0d88fe8b9d6d40f00d3d80a5792c81a91 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 4 Jul 2008 16:58:35 +0000 Subject: [PATCH] Add debug git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7306 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/label.c | 4 ++++ bacula/src/stored/mount.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index e2b9f548ea..1c2d008360 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -324,6 +324,10 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, Dmsg0(150, "write_volume_label()\n"); empty_block(dcr->block); + if (*VolName == 0) { + Pmsg0(0, "=== ERROR: write_new_volume_label_to_dev called with NULL VolName\n"); + goto bail_out; + } if (relabel) { volume_unused(dcr); /* mark current volume unused */ diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index b6f0f02e6f..b4aa2e26ae 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -624,7 +624,8 @@ int DCR::try_autolabel(bool opened) /* Create a new Volume label and write it to the device */ if (!write_new_volume_label_to_dev(dcr, VolumeName, pool_name, false, /* no relabel */ false /* defer DVD label */)) { - Dmsg0(150, "!write_vol_label\n"); + Dmsg2(150, "write_vol_label failed. vol=%s, pool=%s\n", + VolumeName, pool_name); if (opened) { mark_volume_in_error(); } -- 2.39.5