From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67804C282CA for ; Wed, 13 Feb 2019 14:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40B70222C9 for ; Wed, 13 Feb 2019 14:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403932AbfBMOy6 (ORCPT ); Wed, 13 Feb 2019 09:54:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:60246 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403923AbfBMOy5 (ORCPT ); Wed, 13 Feb 2019 09:54:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D213AAD14; Wed, 13 Feb 2019 14:54:55 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 4C3A31E09CD; Wed, 13 Feb 2019 15:54:54 +0100 (CET) From: Jan Kara To: Cc: Amir Goldstein , Konstantin Khlebnikov , Vivek Trivedi , Orion Poplawski , Jan Kara Subject: [PATCH v2 0/6] fanotify: Make wait for permission event response interruptible Date: Wed, 13 Feb 2019 15:54:37 +0100 Message-Id: <20190213145443.26836-1-jack@suse.cz> X-Mailer: git-send-email 2.16.4 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hello, When waiting for response to fanotify permission events, we currently use uninterruptible waits. That makes code simple however it can cause lots of processes to end up in uninterruptible sleep with hard reboot being the only alternative in case fanotify listener process stops responding (e.g. due to a bug in its implementation) - reported e.g. in [1]. Uninterruptible sleep also makes system hibernation fail if the listener gets frozen before the process generating fanotify permission event (as reported e.g. here [2]). This patch set modifies fanotify so that it will use interruptible wait when waiting for fanotify permission event response. Patches are based on current Linus' tree for the ease of testing (I plan to rebase them on top of Amir's pending changes later). I have also create LTP test which stresses handling of permission events while sending processes signals to test the new code [3] Review, comments, and testing are welcome. [1] https://lore.kernel.org/lkml/153474898224.6806.12518115530793064797.stgit@buzz/ [2] https://lore.kernel.org/lkml/c1bb16b7-9eee-9cea-2c96-a512d8b3b9c7@nwra.com/ [3] https://lwn.net/ml/linux-fsdevel/20190108165307.GA11259@quack2.suse.cz/ Changes since v1: * leave pr_debug() calls alone (Amir) * simplify permission event state tracking (Amir) * split some changes into separate patches (Amir) Honza