Re: [PATCH] dcache: make d_splice_alias use d_materialise_unique
From: J. Bruce Fields <hidden>
Date: 2014-02-06 17:03:48
Also in:
linux-fsdevel, lkml
From: J. Bruce Fields <hidden>
Date: 2014-02-06 17:03:48
Also in:
linux-fsdevel, lkml
On Fri, Jan 31, 2014 at 02:47:58PM -0500, J. Bruce Fields wrote:
(Then one remaining thing I don't understand is how to make that fixing up reliable. Or is there some reason nobody hits the _EBUSY case of __d_unalias?)
In fact, a reproducer found thanks to Hideshi Yamaoka:
On server:
while true; do
mv /exports/DIR /exports/TO/DIR
mv /exports/TO/DIR /exports/DIR
done
On client:
mount -olookupcache=pos /mnt
while true; do
ls /mnt/TO;
done
Also on client:
while true; do
strace -e open cat /mnt/DIR/test.txt 2>&1 | grep EBUSY
done
Once all three of those loops are running I hit
open("/mnt/DIR/test.txt", O_RDONLY) = -1 EBUSY
very quickly.
The "lookupcache=pos" isn't really necessary but makes the reproducer
more reliable.
(Originally this was seen on a single client: the client itself was
doing the renames but also continually killing the second mv. I suspect
that means the client sends the RENAME but then fails to update its
dcache, the result being again that the client's dcache is out of sync
with the server's tree and hence lookup is stuck trying to grab a dentry
from another directory.)
Is there some solution short of making ->lookup callers drop the i_mutex
and retry???
--b.