Skip to contentSkip to conversation

d_add on negative dentry?

DISCUSSION Petr Vandrovec 1 participant 1 message Mar 6, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines · Alexander Viro
Quoted 4 lines · Urban Widmark

Is it valid to call d_add on a negative dentry?
(or on a dentry that is already linked in d_hash, but all negative
dentries are, right?)

Not all of them. It _is_ legal to do d_add() on a negative dentry. Doing that for hashed dentries is a bug. Use d_instantiate() instead.
Cheers,
Al

Quoted 4 lines

PS: as for the patch, better make it

    d_instantiate(...);
    if (!hashed)
        d_rehash(...);

It could explain why I'm getting once a month CPU spinning in d_lookup() because of some circular list is no more one circle...
Many thanks, I'll apply it to ncpfs ASAP.
Best regards,
Petr Vandrovec [email protected]