NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59570



The following reply was made to PR bin/59570; it has been noted by GNATS.

From: Brandon Applegate <brandon%burn.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/59570
Date: Wed, 6 May 2026 10:55:51 -0400 (EDT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --8323329-1683336105-1778079352=:2908
 Content-Type: text/plain; format=flowed; charset=ISO-8859-15
 Content-Transfer-Encoding: 8BIT
 
 FYI: this should likely be category "kern" not "bin".  I don't think I can 
 change it this at this point.
 
 Possible root cause found.  Looks like after 7.2 - leading into 8.0 - 
 there was work done on scsipi to make things MPSAFE:
 
 "Make scsipi framework MPSAFE. [mlelstv 20161120]"
 
 I just took a stock 10.1 machine (sparc64) + DAT40 / DDS4 drive (HP 
 C5683A) and did a test.  I applied the patch below (fireaxe I know...) to 
 disable MPSAFE flags for st.c  After doing this I no longer get the tar 
 bad header errors.  I wrote the kernel source directory, and extracted it 
 back to disk.  I didn't get any of the tar errors and also md5s seem to 
 all match:
 
 bash-5.3# diff <(cd /usr/src/sys/ && find . -type f -exec md5 {} + | sort 
 -k 4) <(cd /var/tmp/sttest/ && find . -type f -exec md5 {} + | sort -k 4)
 bash-5.3#
 
 So disclaimer - I am not a C dev so I don't pretend to fully undertsand 
 the 2016 refactor for this code or what all my change has wrought.  But it 
 definitely seems that this refactor > release 7.2 is what is causing real 
 tape drives to fail on reads as I have seen.  Hopefully someone can take a 
 deeper dive and figure out the issue that's happening here - and how to 
 integrate a fix to the MPSAFE work done in 2016.
 
 I will keep this tape drive connected and ready to go - I'm happy to test 
 any kernel tweaks or patches for this.  Thanks.
 
 --- st.c.orig   2026-05-06 07:53:07.402910289 -0400
 +++ st.c        2026-05-06 07:56:16.006832754 -0400
 @@ -114,7 +114,7 @@
          .d_dump = stdump,
          .d_psize = nosize,
          .d_discard = nodiscard,
 -       .d_flag = D_TAPE | D_MPSAFE
 +       .d_flag = D_TAPE
   };
 
   const struct cdevsw st_cdevsw = {
 @@ -129,7 +129,7 @@
          .d_mmap = nommap,
          .d_kqfilter = nokqfilter,
          .d_discard = nodiscard,
 -       .d_flag = D_TAPE | D_MPSAFE
 +       .d_flag = D_TAPE
   };
 
   /*
 
 --
 Brandon Applegate - CCIE 10273
 PGP Key fingerprint:
 A269 60C3 7335 29E3 0DDA 0197 1834 C1F9 A1B2 559A
 "For thousands of years men dreamed of pacts with demons.
 Only now are such things possible."
 --8323329-1683336105-1778079352=:2908--
 



Home | Main Index | Thread Index | Old Index