I made changes in source and created diff file against current svn 
version (in attachment). I put #include in dev.c because I don't know 
how to correctly add header file checking to "configure" script.

I tried this on my test environment and seems to work. Will leave it for 
few more days to verify.

Mariusz

----------------------------------------------------
Już w ten piątek Ty i Ona o godz. 16:00 w Sopocie na molo! Będziesz?
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fd118.html&sid=1225
Index: src/stored/dev.c
===================================================================
--- src/stored/dev.c	(wersja 5199)
+++ src/stored/dev.c	(kopia robocza)
@@ -81,6 +81,7 @@
 
 #include "bacula.h"
 #include "stored.h"
+#include <sys/IBMtape.h>
 
 #ifndef O_NONBLOCK 
 #define O_NONBLOCK 0
@@ -1306,15 +1307,33 @@
             } else if (at_eof() && errno == ENOSPC) {
                stat = 0;
             } else {
-               berrno be;
-               set_eot();
-               clrerror(-1);
-               Dmsg2(100, "Set ST_EOT read errno=%d. ERR=%s\n", dev_errno,
-                  be.bstrerror());
-               Mmsg2(errmsg, _("read error on %s. ERR=%s.\n"),
-                  print_name(), be.bstrerror());
-               Dmsg1(100, "%s", errmsg);
-               break;
+               // ULT3580 - returns EIO while read at EOD
+               struct request_sense sense_data;
+               int rc;
+               Dmsg0(100, "IBM LTO-3 drive: Issuing request sense...\n");
+               memset(&sense_data, 0, sizeof(struct request_sense));
+               rc = ioctl(m_fd, SIOC_REQSENSE, &sense_data);
+               if (rc == 0 && sense_data.err_code == 0x70 && sense_data.key == 0x08 &&
+                              sense_data.asc == 0x00 && sense_data.ascq == 0x05)
+               {
+                  // yes, this is the case
+                  Dmsg0(100, "IBM LTO-3 drive: Seems OK now...\n");
+                  stat = 0;
+               }
+               else
+               {
+                  // no, this means other error
+                  berrno be;
+                  set_eot();
+                  clrerror(-1);
+                  Dmsg2(100, "Set ST_EOT read errno=%d. ERR=%s\n", dev_errno,
+                     be.bstrerror());
+                  Mmsg2(errmsg, _("read error on %s. ERR=%s.\n"),
+                     print_name(), be.bstrerror());
+                  Dmsg1(100, "%s", errmsg);
+                  break;
+               }
+               // end of ULT3580 changes
             }
          }
          if (stat == 0) {                /* EOF */
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to