diff options
| author | Davy Felipe <davyfelipe34@gmail.com> | 2026-09-28 23:03:29 -0300 |
|---|---|---|
| committer | Viacheslav Dubeyko <slava@dubeyko.com> | 2026-09-30 11:11:14 -0700 |
| commit | f278d04be3acfd3a9eccf045b9eb180007cceccc (patch) | |
| tree | 5685356c423f8e88f81886472d0c64ffdc3f9024 /scripts/Makefile.thinlto | |
| parent | 28d4963409507b6b1ebaa9aa1a2ab007bc745958 (diff) | |
| download | linux-f278d04be3acfd3a9eccf045b9eb180007cceccc.tar.gz linux-f278d04be3acfd3a9eccf045b9eb180007cceccc.zip | |
hfs: handle extent B-tree write errors
hfs_brec_insert() may fail while inserting a new extent record, but
__hfs_ext_write_extent() currently ignores its return value and clears
HFS_FLG_EXT_DIRTY and HFS_FLG_EXT_NEW as if the insertion had
succeeded.
Propagate errors returned by hfs_brec_insert() and only clear the
extent flags after a successful insertion.
When updating an existing extent record, hfs_bnode_write() returns
void. Validate the extent write parameters before calling it so an
invalid update is reported as -ERANGE instead of being treated as
successful.
Use a reusable B-tree node range helper that takes the find data and
the expected record size. The helper validates the bnode and tree
pointers, entry offset and entry length, and ensures that the write
range fits within the node.
Negative-path testing in QEMU confirmed that an insertion error is
propagated to the caller. Testing the existing-record path also
confirmed that invalid write parameters are rejected before
HFS_FLG_EXT_DIRTY is cleared.
Changes in v6:
- Rename hfs_bnode_is_valid_range() to is_hfs_bnode_range_valid().
- Use size_t for the expected record size.
- Drop the redundant expected_len validity check.
- Return -ERANGE for invalid find-data/range parameters.
- Incorporate the final review feedback from Viacheslav Dubeyko.
Signed-off-by: Davy Felipe <davyfelipe34@gmail.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20260929020329.32911-1-davyfelipe34@gmail.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
