linux/fs/ocfs2/dlm
Junrui Luo 01b61e8dda ocfs2/dlm: fix off-by-one in dlm_match_regions() region comparison
The local-vs-remote region comparison loop uses '<=' instead of '<',
causing it to read one entry past the valid range of qr_regions.  The
other loops in the same function correctly use '<'.

Fix the loop condition to use '<' for consistency and correctness.

Link: https://lkml.kernel.org/r/SYBPR01MB78813DA26B50EC5E01F00566AF7BA@SYBPR01MB7881.ausprd01.prod.outlook.com
Fixes: ea2034416b ("ocfs2/dlm: Add message DLM_QUERY_REGION")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-03-27 21:19:49 -07:00
..
dlmapi.h ocfs2: miscellaneous spelling fixes 2025-01-12 20:21:07 -08:00
dlmast.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmcommon.h ocfs2/dlm: use bitmap API instead of hand-writing it 2022-11-18 13:55:06 -08:00
dlmconvert.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmconvert.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmdebug.c ocfs2: use str_yes_no() and str_no_yes() helper functions 2025-01-24 22:47:28 -08:00
dlmdebug.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmdomain.c ocfs2/dlm: fix off-by-one in dlm_match_regions() region comparison 2026-03-27 21:19:49 -07:00
dlmdomain.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmlock.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dlmmaster.c ocfs2: remove redundant error code assignment 2026-03-27 21:19:44 -07:00
dlmrecovery.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dlmthread.c all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate 2022-01-15 08:47:31 -08:00
dlmunlock.c ocfs2: replace usage of found with dedicated list iterator variable 2022-04-29 14:37:57 -07:00
Makefile