projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0befb85
)
gfs2: List traversal in do_promote is safe
author
Andreas Gruenbacher
<agruenba@redhat.com>
Sat, 11 Jun 2022 03:00:23 +0000
(
05:00
+0200)
committer
Andreas Gruenbacher
<agruenba@redhat.com>
Wed, 29 Jun 2022 15:01:59 +0000
(17:01 +0200)
In do_promote(), we're never removing the current entry from the list
and so the list traversal is actually safe. Switch back to
list_for_each_entry().
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
patch
|
blob
|
history
diff --git
a/fs/gfs2/glock.c
b/fs/gfs2/glock.c
index 2138460a7369b14e5692777d4c47dae4f16f8612..e79f17d6d001f2bca6e43a9cb608e25432b37aaf 100644
(file)
--- a/
fs/gfs2/glock.c
+++ b/
fs/gfs2/glock.c
@@
-534,11
+534,11
@@
done:
static int do_promote(struct gfs2_glock *gl)
{
- struct gfs2_holder *gh, *
tmp, *
current_gh;
+ struct gfs2_holder *gh, *current_gh;
bool incompat_holders_demoted = false;
current_gh = find_first_strong_holder(gl);
- list_for_each_entry
_safe(gh, tmp
, &gl->gl_holders, gh_list) {
+ list_for_each_entry
(gh
, &gl->gl_holders, gh_list) {
if (test_bit(HIF_HOLDER, &gh->gh_iflags))
continue;
if (!may_grant(gl, current_gh, gh)) {