On Fri, Jun 11, 2021 at 09:00:50AM +0200, Frank Kardel wrote:
> Hi !
> 
> ST_EOM_PENDING is set in st_interpret_sense()
> 
>     - always for fixed block mode on EOM condition
> 
>     - if EWARN enabled and EOM condition for variable block size
> 

 yes indeed.

Here is the patch that makes multi-tape dumps work for me:


Index: st.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/st.c,v
retrieving revision 1.240
diff -u -r1.240 st.c
--- st.c        27 Dec 2019 09:41:51 -0000      1.240
+++ st.c        11 Jun 2021 11:23:10 -0000
@@ -1338,7 +1338,12 @@
                mutex_exit(&st->sc_iolock);
 
                if (error != 0) {
-                       bp->b_error = error;
+                       /* if ststart1 returns EIO, don't return that if
+                        * an EOM is pending otherwise multi-tape dumps
+                        * will error instead of triggering a tape change.
+                        */
+                       if (!((error == EIO) && (st->flags & ST_EOM_PENDING)))
+                               bp->b_error = error;
                        bp->b_resid = bp->b_bcount;
                        biodone(bp);
                }

-- 
Brett Lymn
--
Sent from my NetBSD device.

"We are were wolves",
"You mean werewolves?",
"No we were wolves, now we are something else entirely",
"Oh"

Reply via email to