zfs_rename: another zfs+vfs deadlock

Andriy Gapon avg at FreeBSD.org
Fri Jul 19 10:22:18 UTC 2013


on 17/07/2013 22:45 Konstantin Belousov said the following:
> On Wed, Jul 17, 2013 at 02:03:25PM +0300, Andriy Gapon wrote:
>> A scenario to reproduce this bug could be like this.
>> mkdir a
>> mkdir a/b
>> mv some-file a/b/ (in parallel with) stat a/b
>> Of course it would have to be repeated many times to hit the right timing
>> window.  Also, namecache could interfere with this scenario, but I am not sure.
>>
> 
> There is no questions or proposals on how to approach the fix, JFYI mail ?

I was just reporting the problem and my analysis of it.
A question of "how to fix" was implied.

> I recommend you to look at the ufs_checkpath() and its use in the
> ufs_rename().

Thank you.
That code is enlightening.  I do not think that the approach is directly
applicable to zfs_rename, unfortunately.  But I will try to see if the same kind
of approach could be used.

Also, I noticed that ufs_rename() checks for cross-device rename.  Should all
filesystems do that or should that check belong to VFS layer (if not already
done there)?

-- 
Andriy Gapon


More information about the freebsd-fs mailing list