Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp218919imm; Thu, 26 Jul 2018 02:14:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfee7lZz0c+cKd+vNbr51U0oAEaSmyCN+W/ZWgnWemSV6VBpySPxXlWGnrVM+MFqTFxQ8k4 X-Received: by 2002:a63:a1a:: with SMTP id 26-v6mr1141152pgk.221.1532596448146; Thu, 26 Jul 2018 02:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532596448; cv=none; d=google.com; s=arc-20160816; b=Lt2jW4/AOYr53OB6hRNeNsMDUgwoZc7eev2qZ6KU+5QGKLmN9IV48uk1vaiK8DKeUk BWYS9CaKrU5m5UItbII9omfTbCzn0k7gozmWfej3lA0tZuZTXx11RVZZHZq+bk6IFRwA ul1qbsIGShExAyHOGhrlfDQkuSxpBBRydMr1cQqSSDaiAsfj8+HPuaJB5euqACFFPvFA NDAK9YtQnAdbJ4Rt0z3XDe7+LUdLWurlYnwrRodhQt0pQgsqmGI+w5IwW/D2gymbL9KP aPg904j6bsEJc6qEQe4+nDrCyuDG4xemIgwmhzJ/I/60KhtLTe71L6BOiJvR8duFIPg/ dHMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=wgkDB5feRXNC5Soq1tGPC03sJitTi8zmsSbhym3idY0=; b=WJ8laVdxt9k1zxNyP9NC0Zwq+YdI2d8ky4OBNVQh9NH4TIjglJ9M0XOXVp33NYoLlI u0B5OQYXCez1BdZPKf9SMwZGk3SHA2GJ5VDPO+ZxE+/Es3TuaImabMJwY6eDBlZfa/3Q DWLAzFDF9mq/+8u2giMe6gvcxa3Q4zhxHLjDCqxQvKmg/wMZli3orjnu255t7qLe4rNB aGfQtz0qi9Jkj62SoG9CiiV/tKIlIIx+wlv8y9QL8T3yOqWWpyfC91NgdWxqsJhmqCYA TG5MEKmL+xl5r5n0fJ5JlqVbVvTwYCzwafjdRFgaRka19TvkNFwBKiyzMlY2dvwntdGn 4Agg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="Grev2y/o"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2-v6si854682pga.141.2018.07.26.02.13.52; Thu, 26 Jul 2018 02:14:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="Grev2y/o"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729031AbeGZK2z (ORCPT + 99 others); Thu, 26 Jul 2018 06:28:55 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:37438 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728690AbeGZK2y (ORCPT ); Thu, 26 Jul 2018 06:28:54 -0400 Received: by mail-oi0-f67.google.com with SMTP id k81-v6so1717587oib.4 for ; Thu, 26 Jul 2018 02:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wgkDB5feRXNC5Soq1tGPC03sJitTi8zmsSbhym3idY0=; b=Grev2y/opSG6xbf7Xa4Gxut63kmCKcw0WV3sd1d+Ec1Bl1FtHZn9ZGTXLvBC1eICkP u1drlfljtV34XzfdRAyXGOu/YtO/MyuECl8SxZ9CWgl3zZsO/WXUY6c+1MwXnHWnTT/A 9SIHXUu3YGgYWKwkyVdLzN4OtFEirvz/4GXEA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wgkDB5feRXNC5Soq1tGPC03sJitTi8zmsSbhym3idY0=; b=XJE6Pjs7ExVL+wt77BkfTb5lo77JLP7jvFaqjl9D+yqboSNodL/4zN2hcBhKSXnfKG T90KyNu52njMyTj35JuMoe1evcUmWTzCzE7oR+5pfagPmVHwyb7fjEJPYiBAoPVyo6O7 Av2QJQJCl5o6n6NLnUafTK+tOJ+x0qXbrfY0gZMpee2kXEwGBIFdF32wgLqfF7FGFdJB 39cU14X6gltmwvF12t5oE2loEiLQnacxW5VeQMUHXv1DleFutYBbUiLDd6nWMBg7dnL6 knoaz39o/WCU7B7my37LIYiOigZTxSUlgQuuyLCPefuktCUSo7LkFC0fXfm2mW9YN5+S lDRg== X-Gm-Message-State: AOUpUlHt3iMI6djI4/v7mrGACKGE1a9G/spEtaEO2JjSi7N/HwO/2b7D 50KqUlwE3/Aq4hcHO2t0PUQqWAm7H6Js0Katj+WAYQ== X-Received: by 2002:aca:d04b:: with SMTP id h72-v6mr1033922oig.17.1532596380011; Thu, 26 Jul 2018 02:13:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:113c:0:0:0:0:0 with HTTP; Thu, 26 Jul 2018 02:12:59 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: References: <000000000000bc17b60571a60434@google.com> From: Miklos Szeredi Date: Thu, 26 Jul 2018 11:12:59 +0200 Message-ID: Subject: Re: INFO: task hung in fuse_reverse_inval_entry To: Dmitry Vyukov Cc: linux-fsdevel , LKML , syzkaller-bugs , syzbot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 10:44 AM, Miklos Szeredi wrote: > On Wed, Jul 25, 2018 at 11:12 AM, Dmitry Vyukov wrote: >> On Tue, Jul 24, 2018 at 5:17 PM, Miklos Szeredi wrote: >> Maybe more waits in fuse need to be interruptible? E.g. request_wait_answer? > > That's an interesting aspect. Making request_wait_answer always be > killable would help with the issue you raise (killing set of processes > taking part in deadlock should resolve deadlock), but it breaks > another aspect of the interface. > > Namely that userspace filesystems expect some serialization from > kernel when performing operations. If we allow killing of a process > in the middle of an fs operation, then that serialization is no longer > there, which can break the server. > > One solution to that is to duplicate all locking in the server > (libfuse normally), but it would not solve the issue for legacy > libfuse or legacy non-libfuse servers. It would also be difficult to > test. Also it doesn't solve the problem of killing the server, as > that alone doesn't resolve the deadlock. Umm, we can actually do better. Duplicate all vfs locking in the fuse kernel implementation: when killing a task that has an outstanding request, return immediately (which results in releasing the VFS level lock and hence the deadlock) but hold onto our own lock until the reply from the userspace server comes back. Need to think about the details; this might not be easy to do this properly. Notably memory management locks (page->lock, mmap_sem, etc) are notoriously tricky. Thanks, MIklos