projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b00fde8
)
bcachefs: set disk state should check new_state
author
Dan Robertson
<dan@dlrobertson.com>
Thu, 8 Jul 2021 22:15:38 +0000
(18:15 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:08 +0000
(17:09 -0400)
A new device state that is not a valid state should return -EINVAL
in the disk set state ioctl.
Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/chardev.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/chardev.c
b/fs/bcachefs/chardev.c
index c1d8143b3fd8556ceff5d187a44378cfd1ae5e71..aae9a2db8b0dce4143f5e1c51d3458cc6ac0bf95 100644
(file)
--- a/
fs/bcachefs/chardev.c
+++ b/
fs/bcachefs/chardev.c
@@
-275,7
+275,8
@@
static long bch2_ioctl_disk_set_state(struct bch_fs *c,
BCH_FORCE_IF_METADATA_LOST|
BCH_FORCE_IF_DEGRADED|
BCH_BY_INDEX)) ||
- arg.pad[0] || arg.pad[1] || arg.pad[2])
+ arg.pad[0] || arg.pad[1] || arg.pad[2] ||
+ arg.new_state >= BCH_MEMBER_STATE_NR)
return -EINVAL;
ca = bch2_device_lookup(c, arg.dev, arg.flags);