Deadlock with umount -f involving tmpfs on top of ZFS on r271170
Peter Holm
peter at holm.cc
Wed Sep 24 13:32:48 UTC 2014
On Wed, Sep 24, 2014 at 01:27:58PM +0300, Konstantin Belousov wrote:
> On Tue, Sep 23, 2014 at 08:53:19PM -0500, Bryan Drewery wrote:
> > I tried your patch and still ran into the deadlock. Here is the debug
> > information: https://people.freebsd.org/~bdrewery/vfs_deadlock.2.txt
>
> I see what is going on. Previous patch cannot help there.
>
> The problem is that kern_linkat() starts write with vn_start_write(9),
> and then tries to execute namei(9) with a path potentially crossing
> the mount point. If the mount point is being unmounted, unmount cannot
> lay suspension on the filesystem due to writer, but it owns the covered
> vnode lock. On the other hand, namei(9) is unable to cross the mount
> point since covered vnode is locked, thus writer does not make progress.
>
> The similar issue exists in rename code. The deadlock is only possible
> for filesystems which suspend writes on unmount; such fs are UFS and tmpfs.
>
> Try this.
>
> diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
> index b3b7ed5..9775480 100644
I had been trying different scenarios without much luck, but with
your description I got the problem instantly. :)
The patch is an improvement, but:
http://people.freebsd.org/~pho/stress/log/kostik718.txt
- Peter
More information about the freebsd-fs
mailing list