Fix a lock leak in the ntfs locking scheme:

When ntfs_ntput() reaches 0 in the refcount the inode lockmgr is not
released and directly destroyed. Fix this by unlocking the lockmgr() even
in the case of zero-refcount.

Reported by: dougb, yar, Scot Hetzel <swhetzel at gmail dot com>
Submitted by: yar
This commit is contained in:
Attilio Rao 2008-02-13 13:02:12 +00:00
parent f01bfe5c6d
commit d1215e10d2

View File

@ -462,7 +462,7 @@ ntfs_ntput(ip)
LIST_REMOVE(vap,va_list);
ntfs_freentvattr(vap);
}
mtx_unlock(&ip->i_interlock);
lockmgr(&ip->i_lock, LK_RELEASE | LK_INTERLOCK, &ip->i_interlock);
mtx_destroy(&ip->i_interlock);
lockdestroy(&ip->i_lock);
vrele(ip->i_devvp);