kernel - Fix recursive lockmgr lock panic when creating a hardlink
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 4 Dec 2009 22:32:48 +0000 (14:32 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 4 Dec 2009 22:32:48 +0000 (14:32 -0800)
commit1cd6569033ebea86452882fbb4a29a908568a3eb
treede4eb6b2fced8642c4dcbee159e3f3f924ce2f38
parent82563af8b1cff2d13679a61d42665d2ec213125c
kernel - Fix recursive lockmgr lock panic when creating a hardlink

* HAMMER uses non-recursive vnode locks.  Fix a case where attempting
  to hardlink A to B where both already exist and point to the same
  inode can result in a panic if B is not in the namecache.

  HAMMER must temporarily lock the vnode it returns in the resolver
  and kern_link() was already holding A locked.  This all occurs
  before kern_link() is able to check whether A and B are the same
  so it can't be avoided.

  Solve the problem by unlocking A while resolving B.

Reported-by: Goetz Isenmann <info@goetz-isenmann.de>
sys/kern/vfs_syscalls.c