FreeBSD Bugzilla – Attachment 11260 Details for
Bug 22245
Incorrect handling of end-of-media in atapi cdrom driver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.47 KB, created by
daveg
on 2000-10-23 18:20:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
daveg
Created:
2000-10-23 18:20:00 UTC
Size:
1.47 KB
patch
obsolete
>*** 1117,1125 **** > > if (bp->b_flags & B_READ) { > /* if transfer goes beyond EOM adjust it to be within limits */ >! if (lba + count > cdp->info.volsize) { > /* if we are entirely beyond EOM return EOF */ >! if ((count = cdp->info.volsize - lba) <= 0) { > bp->b_resid = bp->b_bcount; > biodone(bp); > return; >--- 1117,1139 ---- > > if (bp->b_flags & B_READ) { > /* if transfer goes beyond EOM adjust it to be within limits */ >! >! /* >! * The value in cdp->info.volsize is not the last LBA as the name >! * would lead you to believe. It is really the next available (empty) >! * LBA. Also the cdp->info.volsize is numbered 1 to N, not 0 to >! * (N-1). For example, if you have a disk that has 687 2K blocks of >! * data on it the LBA's are numbered 0 to 686. The physical blocks >! * used on the cdrom are 1 to 687 and the value in cdp->info.volsize >! * is 688. >! * >! * So the check needs to be (lba + count >= volsize) and (count = >! * (volsize - 1) - lba). Not (lba + count > volsize) and (count = >! * volsize - lba) which is what FreeBSD 4.0 has. >! */ >! if (lba + count >= cdp->info.volsize) { > /* if we are entirely beyond EOM return EOF */ >! if ((count = (cdp->info.volsize - 1) - lba) <= 0) { > bp->b_resid = bp->b_bcount; > biodone(bp); > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22245
: 11260