From: Kern S. <ke...@si...> - 2005-07-11 16:17:10
|
On Monday 11 July 2005 17:41, Adam Thornton wrote: > This patch seems to fix appending on the (admittedly pretty weird) > IBM 34x0 (in this case, emulated 3480s in a virtual tape system > library) and 359x drives; I don't know if it's generally applicable > but I thought I'd pass it on to you. I realize it's against 1.37.18, > not .25, but if it's something you'd consider putting into the actual > source tree, I'd be happy to do whatever rewriting (if any: I haven't > applied it to my tree yet) it needs for more recent Baculas. > > It's pretty trivial: basically, using FSF to get there gets the tape > placed one file off with the IBM drivers--which is, yes, probably a > driver bug--but these drives know about EOM and apparently implement > it fine, so we use EOM if we have it. I don't see the need for this code, because the same code already exists a bit higher in the source. Unless there is something I don't understand, you simply setup your Device resource and either use the default or make sure you have Hardware End Of Medium set, and Bacula will use the MTEOM function. > > Adam > > Begin forwarded message: > > From: "Bily, Glenn" <Gle...@ei...> > > Date: July 11, 2005 7:58:49 AM CDT > > To: "'Adam Thornton'" <ath...@si...> > > Subject: Bacula append for 3592 and VTS > > > > > > Adam, > > > > This cut and paste mod seems to fix tape append for both. > > > > --- /tmp/bacula-1.37.18/src/stored/dev.c 2005-04-26 > > 15:46:01.000000000 > > -0400 > > +++ /tmp/bacula-1.37.18.mod/src/stored/dev.c 2005-07-08 > > 16:31:51.000000000 > > -0400 > > @@ -682,6 +682,30 @@ > > if (!rewind_dev(dev)) { > > return false; > > } > > + if (dev_cap(dev,CAP_EOM)) { > > + struct mtop mt_com; > > + struct mtget mt_stat; > > + Dmsg0(100,"Using EOM for EOM\n"); > > + mt_com.mt_op = MTEOM; > > + mt_com.mt_count = 1; > > + if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) { > > + berrno be; > > + clrerror_dev(dev, mt_com.mt_op); > > + Dmsg1(50, "ioctl error: %s\n", be.strerror()); > > + update_pos_dev(dev); > > + Mmsg2(dev->errmsg, _("ioctl MTEOM error on %s. ERR=%s. > > \n"), > > + dev->print_name(), be.strerror()); > > + return false; > > + } > > + dev->set_eof(); > > + if (dev_get_os_pos(dev, &mt_stat)) > > + dev->file = mt_stat.mt_fileno; > > + else > > + dev->file = dev->VolCatInfo.VolCatFiles; > > + return true; > > + } > > + else > > + { > > /* > > * Move file by file to the end of the tape > > */ > > @@ -707,6 +731,7 @@ > > return false; > > } > > } > > + } > > } > > /* > > * Some drivers leave us after second EOF when doing -- Best regards, Kern ("> /\ V_V |