Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163230383
D41222.id125609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41222.id125609.diff
View Options
diff --git a/sys/geom/raid/tr_concat.c b/sys/geom/raid/tr_concat.c
--- a/sys/geom/raid/tr_concat.c
+++ b/sys/geom/raid/tr_concat.c
@@ -240,8 +240,10 @@
offset -= vol->v_subdisks[no].sd_size;
no++;
}
- KASSERT(no < vol->v_disks_count,
- ("Request starts after volume end (%ju)", bp->bio_offset));
+ if (no >= vol->v_disks_count) {
+ g_raid_iodone(bp, EIO);
+ return;
+ }
bioq_init(&queue);
do {
sd = &vol->v_subdisks[no];
@@ -267,10 +269,8 @@
addr += length;
offset = 0;
no++;
- KASSERT(no < vol->v_disks_count || remain == 0,
- ("Request ends after volume end (%ju, %ju)",
- bp->bio_offset, bp->bio_length));
- } while (remain > 0);
+ } while (remain > 0 && no < vol->v_disks_count);
+ bp->bio_completed = bp->bio_length - remain;
while ((cbp = bioq_takefirst(&queue)) != NULL) {
sd = cbp->bio_caller1;
cbp->bio_caller1 = NULL;
@@ -308,8 +308,8 @@
offset -= vol->v_subdisks[no].sd_size;
no++;
}
- KASSERT(no < vol->v_disks_count,
- ("Request starts after volume end (%ju)", boffset));
+ if (no >= vol->v_disks_count)
+ return (EIO);
do {
sd = &vol->v_subdisks[no];
length = MIN(sd->sd_size - offset, remain);
@@ -321,10 +321,9 @@
addr += length;
offset = 0;
no++;
- KASSERT(no < vol->v_disks_count || remain == 0,
- ("Request ends after volume end (%ju, %zu)",
- boffset, blength));
- } while (remain > 0);
+ } while (remain > 0 && no < vol->v_disks_count);
+ if (remain > 0)
+ return (EIO);
return (0);
}
@@ -340,7 +339,6 @@
g_destroy_bio(bp);
pbp->bio_inbed++;
if (pbp->bio_children == pbp->bio_inbed) {
- pbp->bio_completed = pbp->bio_length;
g_raid_iodone(pbp, pbp->bio_error);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 6:36 AM (6 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35351716
Default Alt Text
D41222.id125609.diff (1 KB)
Attached To
Mode
D41222: g_raid concat: Fail requests to read beyond the end of the volume
Attached
Detach File
Event Timeline
Log In to Comment