Skip to contentSkip to conversation

RFC: expensive lookup for unlink

DISCUSSION Bernd Schubert 2 participants 2 messages Apr 20, 2012 VFS

lore
Share & tools
lore
#0 lore raw

Hello,

for a network filesystem one should try to avoid all remote operations, if possible. So when I just want to unlink a file, it does not make too much sense to first send a lookup and once the dentry is fully established to unlink the file.

I think the simplest way to solve that is just to add a another nameidata flag (LOOKUP_UNLINK) and the file system may then just ignore the lookup request and fill in fake values.

Or are there any other suggestions to avoid a rather useless network-lookup + network+unlink, so so combine it into one step?

Thanks,
Bernd

#1 lore raw
Quoted 6 lines · Bernd Schubert

for a network filesystem one should try to avoid all remote operations, if possible. So when I just want to unlink a file, it does not make too much sense to first send a lookup and once the dentry is fully established to unlink the file.

I think the simplest way to solve that is just to add a another nameidata flag (LOOKUP_UNLINK) and the file system may then just ignore the lookup request and fill in fake values.

Or are there any other suggestions to avoid a rather useless network-lookup + network+unlink, so so combine it into one step?

We tried this for some time with Lustre as well. The unfortunate problem is that GNU fileutils is stat() happy, so it will stat() every file before unlinking it, so that it can check the file mode and ask "are you sure you want to unlink this?".

As a result, the dentry will almost always be in the dcache already.

Of course, I'm not against fixing this (if no dentry exists, and some applications are not foolish), but it didn't turn out to be as useful as we first thought.

Cheers, Andreas