} else {
bstrncpy(dev->BadVolName, dev->VolHdr.VolumeName, sizeof(dev->BadVolName));
}
- unload_autochanger(dcr, -1);
+ if (!unload_autochanger(dcr, -1)) {
+ /* at least free the device so we can re-open with correct volume */
+ dev->close();
+ }
/* Fall through */
default:
Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
try_autochanger = false;
continue; /* try reading volume mounted */
}
+ /* Try closing and re-opening */
+ dev->close();
+ dev->clear_unload();
+ if (dev->open(dcr, OPEN_READ_ONLY) >= 0) {
+ continue;
+ }
}
/* Mount a specific volume and no other */
{
Jmsg(jcr, M_INFO, 0, _("Marking Volume \"%s\" in Error in Catalog.\n"),
VolumeName);
- dev->VolCatInfo = VolCatInfo; /* structure assignment */
+ dev->VolCatInfo = VolCatInfo; /* structure assignment */
bstrncpy(dev->VolCatInfo.VolCatStatus, "Error", sizeof(dev->VolCatInfo.VolCatStatus));
Dmsg0(150, "dir_update_vol_info. Set Error.\n");
dir_update_volume_info(this, false, false);
volume_unused(this);
+ dev->set_unload(); /* must get a new volume */
}
/*
if (dev->is_open()) {
dev->offline_or_rewind();
}
+ dev->set_unload();
Dmsg0(190, "release_volume\n");
}
#undef VERSION
#define VERSION "2.3.18"
-#define BDATE "16 April 2008"
-#define LSMDATE "16Apr08"
+#define BDATE "19 April 2008"
+#define LSMDATE "19Apr08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
+19Apr08
+kes Force unload of volume when wrong volume mounted in SD.
17Apr08
kes Fix bat seg fault at termination.
kes Add Bacula generated version to bat about box.