summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorDaeMyung Kang <charsyam@gmail.com>2026-05-22 17:20:48 +0300
committerNamjae Jeon <linkinjeon@kernel.org>2026-06-05 18:19:49 +0300
commitc05132077df57a384919f61d7f8a8e76d748a6d4 (patch)
tree45ccb20dadfcc09f08c6e16fd7a14166dfbb3cf4 /include/linux/timerqueue.h
parent76bc14c7097ff678b2b5dbfd4fa33b46897d87ce (diff)
downloadlinux-c05132077df57a384919f61d7f8a8e76d748a6d4.tar.xz
ntfs: avoid heap allocation for free-cluster readahead state
get_nr_free_clusters() allocates a temporary file_ra_state before it publishes the precomputed free cluster count, sets NVolFreeClusterKnown(), and wakes vol->free_waitq. If that allocation fails, the worker returns without setting the flag or waking waiters, so callers waiting for the free count can block indefinitely. The readahead state is only used synchronously while scanning the bitmap. Keep it on the stack and pass it by address to the readahead helper. This eliminates the early allocation failure path instead of adding a special case that publishes a conservative count and wakes the waitqueue. Zero-initialize the on-stack state because file_ra_state_init() only sets ra_pages and prev_pos. Apply the same treatment to __get_nr_free_mft_records(), which scans the MFT bitmap with the same short-lived readahead state. Cc: stable@vger.kernel.org # v7.1 Signed-off-by: DaeMyung Kang <charsyam@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions