>I know I cut off the transfer length, but I also return the missing
>size in b_resid, so the kernel _should_ come back with the rest of
>the transfer in a new request or at least fail on the unsatisfied
>request, and on my system it does seem to work...
>If this doesn't work in all cases, some other part of the kernel is
>broken IMHO. I thought of minphys once, but that seems not to work
>anymore either...

Using a driver-specific minphys is the correct method for unbuffered
i/o, especially for tapes.  This was recently made harder to use by
replacing the specialised driver read/write routines by general ones
(physread/physwrite).

minphys and b_resid don't work for buffered i/o.  vfs_bio.c doesn't even
look at b_resid, so short i/o's are considered to have been complete.
This is not much of a problem, because buffered i/o's are limited to
MAXBSIZE (64K), and filesystems shouldn't have partial fs-blocks at the
end of a disk.  Buffered i/o's larger than MAXBSIZE can only occur for
clustered i/o's if the driver supports them.  E.g., the wd driver can
easily transfer 255 sectors and it sets d_maxio to 248 so that clusters
up to size 124K get created.

Bruce


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to