afs: Fix missing/incorrect unlocking of RCU read lock
Subsystems (2)
David Howells
maintainerPATCH 1/1 afs: Fix missing/incorrect unlocking of RCU read lock
In afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both places before returning (and not lock it again).
--- fs/afs/proc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/afs/proc.c +3 -2
@@ -166,7 +166,7 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v)if (!preflist) {seq_puts (m,"NO PREFS\n" ); -return 0 ; + goto out; } seq_printf(m, "PROT SUBNET PRIOR (v=%u n=%u/%u/%u)\n",
@@ -191,7 +191,8 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v) } } -rcu_read_lock (); +out: +rcu_read_unlock ();return 0 ; }
David Howells
maintainerQuoted 5 lines · David Howells
In
afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both places before returning (and not lock it again).Fixes f94f70d39cc2 ("afs: Provide a way to configure address priorities")Reported-by Marc Dionne <[email protected]>
Actually:
Quoted 3 lines
David
Quoted 11 lines · David Howells
Quoted 5 lines · David Howells
In
afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both places before returning (and not lock it again).Fixes f94f70d39cc2 ("afs: Provide a way to configure address priorities")Reported-by Marc Dionne <[email protected]>Actually:
Quoted 7 lines
Reported-by kernel test robot <[email protected]>Quoted 3 lines
David
The fix looks fine.
Marc
Quoted 29 lines
2024年1月18日 00:14,David Howells <[email protected]> 写道:
In
afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both places before returning (and not lock it again).Fixes f94f70d39cc2 ("afs: Provide a way to configure address priorities")Reported-by Marc Dionne <[email protected]>Signed-off-by David Howells <[email protected]>---
fs/afs/proc.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)fs/afs/proc.c +1
-1@@ -166,7 +166,7 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v)if (!preflist) {seq_puts (m,"NO PREFS\n" ); -return 0 ; + goto out; } seq_printf(m, "PROT SUBNET PRIOR (v=%u n=%u/%u/%u)\n",
fs/afs/proc.c static int afs_proc_addr_prefs_show(struct seq_file *m, void *v) · line 195
Quoted 6 lines
fs/afs/proc.c +2
-1@@ -191,7 +191,8 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v) } } -rcu_read_lock (); +out: +rcu_read_unlock ();
What about using:
guard(rcu)();
Thanks,
Alan
Quoted 4 lines
fs/afs/proc.c +0
-0return 0 ; }