summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/system.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-04-15 15:41:57 +0000
committermarcel <marcel@FreeBSD.org>2014-04-15 15:41:57 +0000
commit8dd37471400a14b39911e87f5306bd300fd567be (patch)
tree1e9c882bba953e1eb7dda3a4b046c97d1044ab2b /lib/libc/stdlib/system.c
parent04f26f523588a7df586411bd86fde99acada76e1 (diff)
downloadFreeBSD-src-8dd37471400a14b39911e87f5306bd300fd567be.zip
FreeBSD-src-8dd37471400a14b39911e87f5306bd300fd567be.tar.gz
Make sure not to do I/O for more than MAXPHYS bytes. Doing so can cause
problems in our providers, such as a KASSERT in md(4). We can initiate I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS bytes, the blocks from which we're reading couldn't be compressed and we had compression in preceeding blocks resulting in misalignment of the blocks we're trying to read relative to the sector. We're forced to round up the I/O length to make it an multiple of the sector size. When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uzip_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. Obtained from: Juniper Networks, Inc.
Diffstat (limited to 'lib/libc/stdlib/system.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud