]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dlm: replace usage of found with dedicated list iterator variable
authorJakob Koschel <jakobkoschel@gmail.com>
Wed, 6 Apr 2022 18:05:31 +0000 (14:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:18:11 +0000 (16:18 +0200)
commitdf9c842ab0a4b701189c1021982ca3f592e5dcee
treeb31c15f8fe2fa56c058c0dd184e66867d3582d8f
parent33e9c610e337ae6f31fa8a3ad169df043140a3cf
dlm: replace usage of found with dedicated list iterator variable

[ Upstream commit dc1acd5c94699389a9ed023e94dd860c846ea1f6 ]

To move the list iterator variable into the list_for_each_entry_*()
macro in the future it should be avoided to use the list iterator
variable after the loop body.

To *never* use the list iterator variable after the loop it was
concluded to use a separate iterator variable instead of a
found boolean [1].

This removes the need to use a found variable and simply checking if
the variable was set, can determine if the break/goto was hit.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Stable-dep-of: 57e2c2f2d94c ("fs: dlm: fix mismatch of plock results from userspace")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/lock.c
fs/dlm/plock.c
fs/dlm/recover.c