FreeBSD Bugzilla – Attachment 174075 Details for
Bug 212139
r298900 introduced a fatal failure case for >2TB disk size reporting bugs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Thought experiment alternative patch
p (text/plain), 986 bytes, created by
Peter Wemm
on 2016-08-25 20:18:39 UTC
(
hide
)
Description:
Thought experiment alternative patch
Filename:
MIME Type:
Creator:
Peter Wemm
Created:
2016-08-25 20:18:39 UTC
Size:
986 bytes
patch
obsolete
>Index: i386/libi386/biosdisk.c >=================================================================== >--- i386/libi386/biosdisk.c (revision 304792) >+++ i386/libi386/biosdisk.c (working copy) >@@ -511,21 +511,21 @@ > DEBUG("open_disk %p", dev); > blks = size / BD(dev).bd_sectorsize; > if (rsize) > *rsize = 0; > >- if (dblk >= BD(dev).bd_sectors) { >- DEBUG("IO past disk end %llu", (unsigned long long)dblk); >- return (EIO); >- } >- >- if (dblk + blks > BD(dev).bd_sectors) { >- /* perform partial read */ >- blks = BD(dev).bd_sectors - dblk; >+#define clip(x) ((x) & 0xffffffff) >+ if (clip(dblk + blks) > clip(BD(dev).bd_sectors)) { >+ /* >+ * perform partial read to prevent readahead crossing >+ * any 32 bit aliases of the end of disk. >+ */ >+ blks = clip(BD(dev).bd_sectors) - clip(dblk); > size = blks * BD(dev).bd_sectorsize; > DEBUG("short read %d", blks); > } >+#undef clip > > switch(rw){ > case F_READ: > DEBUG("read %d from %lld to %p", blks, dblk, buf); >
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 212139
:
174052
|
174075
|
174080