If the entry is found in name cache, cache_lookup() does all the
necessary locking now, simplifying the interface and making the
code easier to follow and maintain.
The code now also removes the entry from cache when it's either invalid
(vget() fails) or the vnode has been recycled while waiting for the lock.
In that case, unlock/relock of the directory vnode has been eliminated too.
Both changes could lead to sligh performace improvement in same cases.
Furthermore, obscure bug has been found and eliminated for ISDOTDOT in the
lockparent && ISLASTCN case: if the vget() succeded and the re-lock
of the directory vnode not, we returned the error with the '..' vnode still
locked.
For simplicity, cache_lookup() now returns 0 if the positive entry was found
in cache, -1 if not found and ENOENT or error returned by the locking
functions in any other case.
Many thanks to Bill Studenmund and especially Charles Hannum
for invaluable advices and code to get this right.
Tested by: jdolecek
Rewieved by: wrstuden, mycroft
routines - avoids potential DoS attack and closes an easy way to force
the kernel to panic
* for read(), DTRT WRT offset bigger than file size
ntfs_strategy(): adapt to ntfs_readattr() change
ntfs_readdir(): use ntfs_u28() to translate the file name characters
to 8bit encoding, avoid excessive intendation, reformat the
debug messages slightly
- do not perform IPv6 initialization for faith* interface, as they become
mistakingly IFF_UP. we are wondering if we should nuke in6_ifattach_p2p().
(sync with recent kame)
uio parameter; if it's not null, the data are copied directly
into/from the user buffer via uiomove()
new macro NTFS_U28() and function ntfs_u28() to convert between Unicode
and 8bit encoding; all it does currently is getting lower 8bit
of the Unicode char and subtituting '_' for it if the result would be 0;
use the macro within NTFS_TOUPPER() macro and in ntfs_uastrcmp()
g/c the (ntfsmount *) parametr to ntfs_u*astr[i]cmp() functions, it's no
longer needed
avoid excessive intendation
filesystem. In particular,
- Fix mknod deadlock, described in PR 8172.
- Enable lfs_mountroot.
- Make lfs_writevnodes treat filesystems mounted on lfs device nodes properly,
by flushing that device rather than trying to add blocks to the device inode.
This, in combination with lfs boot blocks, will allow operation of an all-lfs
system.