diff options
author | Integral <integral@archlinuxcn.org> | 2025-04-06 22:53:28 +0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-06 19:13:47 -0400 |
commit | 2a5cf9df4dbcd0cf5ceb1ff1f33fd70d2490c0e7 (patch) | |
tree | 6176aea33fc71a125293e7982a8c13df8193e939 /fs/btrfs/tree-mod-log.c | |
parent | aa0ce286eeae062355120d960ad5f9925cfb23d9 (diff) |
bcachefs: early return for negative values when parsing BCH_OPT_UINT
Currently, when passing a negative integer as argument, the error
message is "too big" due to casting to an unsigned integer:
> bcachefs format --block_size=-1 bcachefs.img
invalid option: block_size: too big (max 65536)
When negative value in argument detected, return early before
calling bch2_opt_validate().
A new error code `BCH_ERR_option_negative` is added.
Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/btrfs/tree-mod-log.c')
0 files changed, 0 insertions, 0 deletions