Commit Graph

16 Commits

Author SHA1 Message Date
elric befeae8929 Modified the dksubr routines to:
o  expect the disk's start routine to return an int.  If the
	   int is non-zero, we enqueue the request and try again
	   later.
	o  have a dk_start() routine which runs the request queue.
	o  have a dk_iodone() function which should be called by the
	   driver using the framwork from its iodone.  dk_iodone will
	   retry the queue since presumably further progress may be
	   possible once a request is complete.  It is required that
	   the underlying driver have the resources to keep at least
	   one transaction in flight at any time.

Modified cgd to:

	o  be able to keep one transaction in flight at any time
	   (almost) by keeping a buffer of size MAXPHYS in its softc
	   and use it.

We still need to make the cgd_cbufpool per device rather than global
and provide a low water mark for it.

Addresses PR: kern/24715
(at least according to the submitter.)
2004-03-27 23:23:06 +00:00
dan b912bfcc09 Fix a longstanding bug in key-handling for the blowfish cipher.
This is an incompatible change, and will break all existing cgd images
encrypted with blowfish. Users will need to dump their data before
booting a kernel with this change, and recreate cgd's and restore data
afterwards.

I believe this affects a very small number of users other than myself;
indeed after several alert mails in an attempt to find them, only 2
such users have come forward. They have both agreed the requirement
for backwards compatibility does not warrant the effort nor the mess
in the code.  This code does exist, if it should later prove to be
needed, but will not be in the tree.

Further, by the nature of the issue, I have strong reasons to believe
that, even if they missed these mails, there would be few other users
of blowfish who update their systems with any regularity; any such
users would have tripped over the problem in the same way I did when
it was first found over a year ago.

The problem stems from two issues with the underlying blowfish
encryption routines used by cgd:
 - they take key length arguments counted in bytes, rather than bits
   like all the opther ciphers.
 - they silently truncate any keys longer than an internal limit,
   rather than returning an error (which would have exposed the
   previous discrepancy immediately).

As a result, the kernel reads too much data as the key from cgdconfig,
and then truncates most of it. This can easily be demonstrated/tested.
Currently, Blowfish users will find that if they mis-enter the cgd
passphrase on the first attempt, when validation fails and cgdconfig
prompts for the passphrase again, the cgd will not correctly configure
even when given a correct passphrase.
2004-03-18 10:42:08 +00:00
hannken 3db4e2acd8 Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp)  Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp)      Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
2004-01-25 18:06:48 +00:00
yamt 7266a95907 store a i/o priority hint in struct buf for buffer queue discipline. 2004-01-10 14:39:50 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
agc 23a6c4c9b7 Test the right variable after allocating space, and then get rid of an
unused local variable.
2003-05-17 14:26:30 +00:00
dsl bd99e3429d Use 'void *' instead of 'caddr_t' in prototypes of VOP_IOCTL, VOP_FCNTL
and VOP_ADVLOCK, delete casts from callers (and some to copyin/out).
2003-03-21 23:11:19 +00:00
thorpej eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
bouyer 5700f75418 Fix DEBUG printf warning. 2003-02-02 20:55:16 +00:00
mrg 603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00
jdolecek 4501e88f21 put back the D_DISK tag for cdevsw mistakely removed in previous
revision
2002-10-24 08:04:00 +00:00
augustss 37da939075 Make it compile after the kq changes.
XXX I'm not sure what kqfilter cgd should have, it gets nokqfilter for now.
2002-10-24 01:43:54 +00:00
elric faa24007eb Allow debugging to work on LP64 arches. 2002-10-14 19:16:55 +00:00
elric 4366a007ff The CryptoGraphic Disk Driver. 2002-10-04 18:22:35 +00:00