mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
fs: set the correct nr_items to 0 in the ENOENT search case
Commit 72c3bf8438830b65cae7bdaff126053e562280e5 ("fs: handle ENOENT within lib") was meant to prevent exceptions when a subvol is deleted. If the search ioctl fails, the kernel won't set nr_items in the ioctl output, which means `nr_items` still has the input value. When ENOENT is detected, `this->nr_items` is set to 0, then later `*this = ioctl_ptr->key` overwrites `this->nr_items` with the original requested number of items. This replaced the ENOENT exception with an exception triggered by interpreting garbage in the memory buffer. The number of exceptions was reduced because the memory buffers are frequently reused, but upper layers would then reject the data or ignore it because it didn't match the key range. Fix by setting `ioctl_ptr->key.nr_items`, which then overwrites `this->nr_items`, so the loop that extracts items from the ioctl data gets the right number of items (i.e. zero). Fixes: 72c3bf8438830b65cae7bdaff126053e562280e5 ("fs: handle ENOENT within lib") Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
e40339856f
commit
d74862f1fc
Loading…
x
Reference in New Issue
Block a user