Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
811ba89a
Commit
811ba89a
authored
Apr 28, 2024
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bdev: move ->bd_make_it_fail to ->__bd_flags
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
49a43dae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
block/blk-core.c
block/blk-core.c
+2
-1
block/genhd.c
block/genhd.c
+8
-4
include/linux/blk_types.h
include/linux/blk_types.h
+3
-3
No files found.
block/blk-core.c
View file @
811ba89a
...
...
@@ -494,7 +494,8 @@ __setup("fail_make_request=", setup_fail_make_request);
bool
should_fail_request
(
struct
block_device
*
part
,
unsigned
int
bytes
)
{
return
part
->
bd_make_it_fail
&&
should_fail
(
&
fail_make_request
,
bytes
);
return
bdev_test_flag
(
part
,
BD_MAKE_IT_FAIL
)
&&
should_fail
(
&
fail_make_request
,
bytes
);
}
static
int
__init
fail_make_request_debugfs
(
void
)
...
...
block/genhd.c
View file @
811ba89a
...
...
@@ -1066,7 +1066,8 @@ static DEVICE_ATTR(diskseq, 0444, diskseq_show, NULL);
ssize_t
part_fail_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
return
sprintf
(
buf
,
"%d
\n
"
,
dev_to_bdev
(
dev
)
->
bd_make_it_fail
);
return
sprintf
(
buf
,
"%d
\n
"
,
bdev_test_flag
(
dev_to_bdev
(
dev
),
BD_MAKE_IT_FAIL
));
}
ssize_t
part_fail_store
(
struct
device
*
dev
,
...
...
@@ -1075,9 +1076,12 @@ ssize_t part_fail_store(struct device *dev,
{
int
i
;
if
(
count
>
0
&&
sscanf
(
buf
,
"%d"
,
&
i
)
>
0
)
dev_to_bdev
(
dev
)
->
bd_make_it_fail
=
i
;
if
(
count
>
0
&&
sscanf
(
buf
,
"%d"
,
&
i
)
>
0
)
{
if
(
i
)
bdev_set_flag
(
dev_to_bdev
(
dev
),
BD_MAKE_IT_FAIL
);
else
bdev_clear_flag
(
dev_to_bdev
(
dev
),
BD_MAKE_IT_FAIL
);
}
return
count
;
}
...
...
include/linux/blk_types.h
View file @
811ba89a
...
...
@@ -51,6 +51,9 @@ struct block_device {
#define BD_WRITE_HOLDER (1u<<9)
#define BD_HAS_SUBMIT_BIO (1u<<10)
#define BD_RO_WARNED (1u<<11)
#ifdef CONFIG_FAIL_MAKE_REQUEST
#define BD_MAKE_IT_FAIL (1u<<12)
#endif
dev_t
bd_dev
;
struct
inode
*
bd_inode
;
/* will die */
...
...
@@ -67,9 +70,6 @@ struct block_device {
struct
mutex
bd_fsfreeze_mutex
;
/* serialize freeze/thaw */
struct
partition_meta_info
*
bd_meta_info
;
#ifdef CONFIG_FAIL_MAKE_REQUEST
bool
bd_make_it_fail
;
#endif
int
bd_writers
;
/*
* keep this out-of-line as it's both big and not needed in the fast
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment