msdosfs: fix bug in msfdosfs_hashins().
authorNicolas Thery <nthery@gmail.com>
Thu, 26 Feb 2009 03:29:14 +0000 (04:29 +0100)
committerNicolas Thery <nthery@gmail.com>
Thu, 26 Feb 2009 03:38:29 +0000 (04:38 +0100)
commit2d4cdfafc8fce900fb62864cc36040d7485eb059
tree816475b54fc1e67a7ff235ef8cbaad9279eaba5f
parent47d87cf2ddce753f59522b9f294d8ad83bbc0a81
msdosfs: fix bug in msfdosfs_hashins().

This function returns an error if there is already a denode in the hash table:
EBUSY if the hashed denode represents a live file and EINVAL if it represents a
deleted but still opened file.

There was a typo in the function causing it to check for liveness in the denode
to insert instead of the already inserted one.  As a consequence, if N threads
were in a race in deget() to insert a new denode for the same file in the hash
table, the losers would fail with EINVAL instead of retrying.
sys/vfs/msdosfs/msdosfs_denode.c