Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
ad8890a7
Commit
ad8890a7
authored
12 years ago
by
Dor Laor
Browse files
Options
Downloads
Patches
Plain Diff
Handles aspects of RO disk - fail writes on all paths
and call biodone when appropriate
parent
3755f465
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/virtio-blk.cc
+4
-5
4 additions, 5 deletions
drivers/virtio-blk.cc
with
4 additions
and
5 deletions
drivers/virtio-blk.cc
+
4
−
5
View file @
ad8890a7
...
...
@@ -63,6 +63,7 @@ virtio_blk_write(struct device *dev, struct uio *uio, int ioflags)
struct
virtio_blk_priv
*
prv
=
reinterpret_cast
<
struct
virtio_blk_priv
*>
(
dev
->
private_data
);
if
(
prv
->
drv
->
is_readonly
())
return
EROFS
;
if
(
uio
->
uio_offset
+
uio
->
uio_resid
>
prv
->
drv
->
size
())
return
EIO
;
...
...
@@ -191,10 +192,7 @@ struct driver virtio_blk_driver = {
virtio_d
(
fmt
(
"
\t
value = %d len=%d"
)
%
(
int
)(
*
buf
)
%
ii
->
_len
);
}
if
(
req
->
bio
!=
nullptr
)
{
biodone
(
req
->
bio
);
req
->
bio
=
nullptr
;
}
biodone
(
req
->
bio
);
delete
req
;
}
...
...
@@ -208,7 +206,6 @@ struct driver virtio_blk_driver = {
if
(
req_header
)
delete
reinterpret_cast
<
virtio_blk_outhdr
*>
(
req_header
);
if
(
payload
)
delete
payload
;
if
(
status
)
delete
status
;
if
(
bio
)
delete
bio
;
}
int
virtio_blk
::
size
()
{
...
...
@@ -239,6 +236,8 @@ struct driver virtio_blk_driver = {
case
BIO_WRITE
:
if
(
is_readonly
())
{
virtio_e
(
"Error: block device is read only"
);
bio
->
bio_flags
|=
BIO_ERROR
|
BIO_DONE
;
biodone
(
bio
);
return
EROFS
;
}
type
=
VIRTIO_BLK_T_OUT
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment