Loading
dm cache: optimize dirty bit checking with find_next_bit when resizing
stable inclusion from stable-v5.10.230 commit f136d8d3f26fd5113e80ba7c70f7e9a5932295b3 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB5AV2 CVE: CVE-2024-50278 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f136d8d3f26fd5113e80ba7c70f7e9a5932295b3 -------------------------------- commit f484697e619a83ecc370443a34746379ad99d204 upstream. When shrinking the fast device, dm-cache iteratively searches for a dirty bit among the cache blocks to be dropped, which is less efficient. Use find_next_bit instead, as it is twice as fast as the iterative approach with test_bit. Signed-off-by:Ming-Hung Tsai <mtsai@redhat.com> Fixes: f494a9c6 ("dm cache: cache shrinking support") Cc: stable@vger.kernel.org Signed-off-by:
Mikulas Patocka <mpatocka@redhat.com> Acked-by:
Joe Thornber <thornber@redhat.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Zheng Qixing <zhengqixing@huawei.com>