Skip to content

Commit a282a1f

Browse files
J. Bruce Fieldsarndb
authored andcommitted
lockd: fix nlmsvc_notify_blocked locking
nlmsvc_notify_blocked walks the nlm_blocked list, which requires nlm_blocked_lock. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 763641d commit a282a1f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/lockd/svclock.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,14 +700,16 @@ nlmsvc_notify_blocked(struct file_lock *fl)
700700
struct nlm_block *block;
701701

702702
dprintk("lockd: VFS unblock notification for block %p\n", fl);
703+
spin_lock(&nlm_blocked_lock);
703704
list_for_each_entry(block, &nlm_blocked, b_list) {
704705
if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) {
705-
nlmsvc_insert_block(block, 0);
706+
nlmsvc_insert_block_locked(block, 0);
707+
spin_unlock(&nlm_blocked_lock);
706708
svc_wake_up(block->b_daemon);
707709
return;
708710
}
709711
}
710-
712+
spin_unlock(&nlm_blocked_lock);
711713
printk(KERN_WARNING "lockd: notification for unknown block!\n");
712714
}
713715

0 commit comments

Comments
 (0)