HomeFreeBSD

g_raid concat: Fail requests to read beyond the end of the volume

Description

g_raid concat: Fail requests to read beyond the end of the volume

Previously a debug kernel would trigger an assertion failure if an I/O
request attempted to read off the end of a concat volume, but a
non-debug kernel would use an invalid sub-disk to try to complete the
request eventually resulting in some sort of fault in the kernel.

Instead, turn the assertions into explicit checks that fail requests
beyond the end of the volume with EIO. For requests which run over
the end of the volume, return a short request.

PR: 257838
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41222

(cherry picked from commit 4c89c0127dcadaa0d337c23d028f3fea5e76317a)

Details

Provenance
jhbAuthored on Aug 4 2023, 11:41 PM
Reviewer
emaste
Differential Revision
D41222: g_raid concat: Fail requests to read beyond the end of the volume
Parents
rG0db7f4b419db: udf: Reject read requests with an invalid length
Branches
Unknown
Tags
Unknown