Bacula fails on FreeBSD 10.x / "mt fsf" infinitely proceeds

Joerg Wunsch freebsd-scsi at uriah.heep.sax.de
Wed Jul 30 21:51:20 UTC 2014


As Alexander Motin wrote:

> Yes, that was me who removed that second type handling from sastart().
> The same was done for all other drivers as part of CAM simplification
> efforts. Probably I missed the fact that sa(4) uses that type for
> something else.

Well, a quick glance at the remainder of the driver shows that the
typemask is just a single bit, so if you remove one of its possible
values, you should have questioned the entire type field/mask in turn,
as it became useless then.

#define	SA_CCB_BUFFER_IO	0x0
#define	SA_CCB_TYPEMASK		0x1
#define	SA_POSITION_UPDATED	0x2

#define	Set_CCB_Type(x, type)				\
	x->ccb_h.ccb_pflags &= ~SA_CCB_TYPEMASK;	\
	x->ccb_h.ccb_pflags |= type

SA_CCB_BUFFER_WAITING was indeed not tested anywhere else, but there
are decisions based on SA_CCB_BUFFER_IO (which used to be the opposite
of SA_CCB_BUFFER_WAITING).  These decisions now became random
decisions. :-(

> So while type may indeed be restored (I have no idea
> about that aspect of sa(4) driver, neither have hardware to test it)

Not having the hardware doesn't seem to be a good base for modifying
the driver in the first place to me.

Ken, I think that entire CCB_Type stuff can go away then as it is not
used anymore.  The only side-effect I see is that parts of
MTIOCERRSTAT are rendered useless now, as the distinction between
control and IO transfers is gone.

Unfortunately, the new Bugzilla doesn't seem to accept me (I tried
Peter Wemm's description about kinit / kpasswd), so I cannot open
a bug report for it.

Attached is a suggested patch.  So far, I only compile-tested it.
-- 
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scsi_sa.c.diff
Type: text/x-diff
Size: 6105 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-scsi/attachments/20140730/e3a8f739/attachment.diff>


More information about the freebsd-scsi mailing list