Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115867667
D31293.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
D31293.diff
View Options
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -654,19 +654,6 @@
error = EINVAL;
break;
}
- if ((pp->mediasize > 0) && (offset >= pp->mediasize)) {
- /*
- * Catch out-of-bounds requests here. The problem is
- * that due to historical GEOM I/O implementation
- * peculatities, g_delete_data() would always return
- * success for requests starting just the next byte
- * after providers media boundary. Condition check on
- * non-zero media size, since that condition would
- * (most likely) cause ENXIO instead.
- */
- error = EIO;
- break;
- }
while (length > 0) {
chunk = length;
if (g_dev_del_max_sectors != 0 &&
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -886,6 +886,8 @@
bp->bio_data = ptr;
g_io_request(bp, cp);
errorc = biowait(bp, "gread");
+ if (errorc == 0 && bp->bio_completed != length)
+ errorc = EIO;
if (error != NULL)
*error = errorc;
g_destroy_bio(bp);
@@ -940,6 +942,8 @@
bp->bio_data = ptr;
g_io_request(bp, cp);
error = biowait(bp, "gwrite");
+ if (error == 0 && bp->bio_completed != length)
+ error = EIO;
g_destroy_bio(bp);
return (error);
}
@@ -971,6 +975,8 @@
bp->bio_data = NULL;
g_io_request(bp, cp);
error = biowait(bp, "gdelete");
+ if (error == 0 && bp->bio_completed != length)
+ error = EIO;
g_destroy_bio(bp);
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 7:04 PM (12 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17863013
Default Alt Text
D31293.diff (1 KB)
Attached To
Mode
D31293: geom: Handle truncated I/O in g_*_data()
Attached
Detach File
Event Timeline
Log In to Comment