Bug 1662454

Summary: Bacula is unable to position LTO4 tape in F29
Product: [Fedora] Fedora Reporter: Brian Daniels <bitmage>
Component: baculaAssignee: Simone Caronni <negativo17>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: andreas, jridky, negativo17, phracek, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-12 14:40:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brian Daniels 2018-12-28 16:41:26 UTC
Description of problem:
After upgrading to F29, Bacula failed to label tapes on a SCSI LTO-4 drive.  A btape test could no longer seek to tape blocks.
  
If I reboot to F28 using the same bacula-sd.conf, the test passes again.
I'm not sure if this is a Bacula issue or a aic79xx issue.

My SCSI card is using the aic79xx kernel module:
aic79xx               151552  0
scsi_transport_spi     40960  1 aic79xx

btape output under F29:
sudo btape -c /etc/bacula/bacula-sd.conf /dev/nst0
Tape block granularity is 1024 bytes.
btape: butil.c:290-0 Using device: "/dev/nst0" for writing.
btape: btape.c:478-0 open device "LTO4" (/dev/nst0): OK
*test

=== Write, rewind, and re-read test ===

I'm going to write 10000 records and an EOF
then write 10000 records and an EOF, then rewind,
and re-read the data to verify that it is correct.

This is an *essential* feature ...

btape: btape.c:1161-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:612-0 Wrote 1 EOF to "LTO4" (/dev/nst0)
btape: btape.c:1177-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:612-0 Wrote 1 EOF to "LTO4" (/dev/nst0)
btape: btape.c:1219-0 Rewind OK.
28-Dec 11:20 btape JobId 0: Fatal error: block_util.c:425 Volume data error at 0:0! Wanted ID: "BB02", got "". Buffer discarded.
btape: btape.c:1236-0 Read block 1 failed! ERR=block_util.c:425 Volume data error at 0:0! Wanted ID: "BB02", got "". Buffer discarded.

This test passes without problems on F28.

Device config in bacula-sd.conf:
Device {
  Name = LTO4                      #
  Drive Index = 0
  Media Type = LTO4
  Archive Device = /dev/nst0
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  Offline On Unmount = no;
  Maximum Open Wait = 43200;          # wait 12h for new tape insert
  Maximum Block Size = 64512
  Maximum File Size = 5G;
  Maximum Spool Size = 96G;
  Spool Directory = /mnt/ssdspool/baculaspooldir
}


Version-Release number of selected component (if applicable):
bacula-libs-9.2.1-1.fc29.x86_64
bacula-client-9.2.1-1.fc29.x86_64
bacula-storage-9.2.1-1.fc29.x86_64
bacula-console-bat-9.2.1-1.fc29.x86_64
bacula-director-9.2.1-1.fc29.x86_64
bacula-console-9.2.1-1.fc29.x86_64
bacula-libs-sql-9.2.1-1.fc29.x86_64
bacula-common-9.2.1-1.fc29.x86_64
kernel-modules-4.19.10-300.fc29.x86_64 (aic79xx.ko.xz)


How reproducible:
Always

Steps to Reproduce:
1. Configure bacula for SCSI LTO4 device on /dev/nst0
2. run btape test on blank tape

Actual results:
Test fails with an error related to block seeking.

Expected results:
Test passes.

Additional info:
Same configuration, devices, and tapes work on F28.

Comment 1 Brian Daniels 2018-12-28 20:44:23 UTC
I tried uninstalling bacula-* on my F29 system and then installing the old F28 packages (bacula-libs-9.0.6-8.fc28.x86_64.rpm bacula-client-9.0.6-8.fc28.x86_64.rpm bacula-storage-9.0.6-8.fc28.x86_64.rpm bacula-console-bat-9.0.6-8.fc28.x86_64.rpm bacula-director-9.0.6-8.fc28.x86_64.rpm bacula-console-9.0.6-8.fc28.x86_64.rpm bacula-libs-sql-9.0.6-8.fc28.x86_64.rpm bacula-common-9.0.6-8.fc28.x86_64.rpm)

That did not change the problem, so the issue may be in the aic79xx driver in F29.

Comment 2 Brian Daniels 2018-12-29 03:04:35 UTC
Installing an old F28 kernel to my F29 system (kernel-devel-4.16.3-301.fc28.x86_64.rpm kernel-modules-4.16.3-301.fc28.x86_64.rpm kernel-modules-extra-4.16.3-301.fc28.x86_64.rpm kernel-core-4.16.3-301.fc28.x86_64.rpm) also fixes the problem, so the issue does appear to be there and not in Bacula itself.