Commit 31748207 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: drop tree lock before calling DeleteNotify.

This protects against deadlock should the kernel issue a lookup
synchronously in response. This behavior has been seen on Linux
3.15.3-200.fc20.x86_64.
parent e27b25ab
......@@ -336,10 +336,11 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
// We have to wait until the kernel has forgotten the
// mountpoint, so the write to node.mountPoint is no longer
// racy.
code := c.server.DeleteNotify(parentId, nodeID, name)
if code.Ok() {
mount.treeLock.Unlock()
parentNode.mount.treeLock.Unlock()
code := c.server.DeleteNotify(parentId, nodeID, name)
if code.Ok() {
delay := 100 * time.Microsecond
for {
......@@ -360,10 +361,10 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
}
}
parentNode.mount.treeLock.Lock()
mount.treeLock.Lock()
}
parentNode.mount.treeLock.Lock()
mount.treeLock.Lock()
mount.mountInode = nil
node.mountPoint = nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment