From patchwork Thu Nov 15 18:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10684837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85FFA13BF for ; Thu, 15 Nov 2018 18:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772442CF57 for ; Thu, 15 Nov 2018 18:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68E302CF59; Thu, 15 Nov 2018 18:45:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9B4C2CF57 for ; Thu, 15 Nov 2018 18:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388525AbeKPEyt (ORCPT ); Thu, 15 Nov 2018 23:54:49 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40845 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbeKPEyt (ORCPT ); Thu, 15 Nov 2018 23:54:49 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so13155421wrt.7; Thu, 15 Nov 2018 10:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dpBDOJwbWLuKOijUQBb3r+dOvBKnfaxe1MsrI7Si9nI=; b=Sv7DIMu8hL9XytueKNoLPo4otLnHRnxj2k8WCDl6/YAmbCSrL1MOlnGZLuPytz/Z/o lC3hsqJJIgWuRPQcOSnUj9J1l3i1Z4AYbhiBlnbeO6NC43IWEkmeCCg3ogJQsXeiGm2e UNncKRh4H4UwOscIJrUQTj61/gTZKrtGRZ9CW3ER1SjtozhohDWePnXoX9k5Amf42Sn9 B6Yk6o8d1qJ8K2Ij0OX63anjVyzpbVcpxhcWAfoAHBmW/UEObQxJbW6tGx3gozuxjnke ZtegatlwMUlUwkDBbLM4SH1KdILX0blWy3AzGKlU/PqgAcREltLchFOWy8IOavzcj3lg vmww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dpBDOJwbWLuKOijUQBb3r+dOvBKnfaxe1MsrI7Si9nI=; b=b07096SOBWJ0vF1oaPeYbFlAK5piKtJw/LWm8yC0HF+//vOFTMJEkmo25SJ6O0wSAF RDEPYGBwmuiouBnIUUy36sQIQ2L3XRcrPnF+NmW8ghJANUX96ctDsEJRYORrI+Y29Un4 EEcMwXjumkvvsX9X/ebZ1myAHX91coXvE+EoEOfP/zWHavvviI4k1U8TFuOZRu//W7pH j8PTI0OiyC9CijQeDSLjwdHoOfPgb3+60XDHuuzml3UIldXOtdO0T0/1yf1Wln3xyror DNZttkjC9r4SOEAtfyvaRgZ5xYzeNzFprOlYAWqhGFY4kKcxdJxG6WaLst076Xe+e9Mc iKLw== X-Gm-Message-State: AGRZ1gLpX+b3Nk8rBnSU1m5tFMsngMRZghUKIzHTUbcUFFy+X4qMBP+D CcICD5F+YJPDxxGMKIfCSMbSVuhz X-Google-Smtp-Source: AJdET5ehulKOgvbGEzcpPv72u2QrJuEyxbArFqia5obmEJ2Ixpvgub6QluLUPoH2j2pkI7ee7vzm9g== X-Received: by 2002:adf:c404:: with SMTP id v4-v6mr6800282wrf.20.1542307551482; Thu, 15 Nov 2018 10:45:51 -0800 (PST) Received: from localhost.localdomain ([37.46.46.74]) by smtp.gmail.com with ESMTPSA id s1sm13976327wro.9.2018.11.15.10.45.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 10:45:50 -0800 (PST) From: Amir Goldstein To: Jan Kara Cc: Matthew Bobrowski , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH v2 0/9] fanotify: add support for more event types Date: Thu, 15 Nov 2018 20:45:35 +0200 Message-Id: <20181115184544.30681-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Jan, This is the final part of patch series to add support for filesystem change monitoring to fanotify. The end game is to use: fd = fanotify_init(FAN_CLASS_NOTIF|FAN_REPORT_FID, ...); rc = fanotify_mark(fd, FAN_MARK_FILESYSTEM, FAN_CREATE|FAN_DELETE...); to monitor changes to a large scale namespace. This functionality was not available with inotify API, which does not scale well with recursive directory watches and was not available with fanotify API, which did not support directory modification events. This patch set depends on the fsnotify prep patches posted yesterday. The entire work based on your fsnotify branch is available on my fanotify_dentry branch [1]. I have tested this work with some preliminary LTP tests [2] and a demo program [3]. Matthew Bobrowski has agreed to help me with writing more tests and man pages (thanks Matthew!). Last patch raises a question about how to deal with FAN_ONDIR flag with new event types and proposed a minimal viable implementation that could be used as a base for further discussion. Thanks, Amir. [1] https://github.com/amir73il/linux/commits/fanotify_dentry [2] https://github.com/amir73il/ltp/commits/fanotify_dentry [3] https://github.com/amir73il/fsnotify-utils/blob/master/src/test/fanotify_demo.c Amir Goldstein (9): fanotify: rename struct fanotify_{,perm_}event_info fanotify: define the structures to report a unique file identifier fanotify: classify events that hold a file identifier fanotify: encode file identifier for FAN_REPORT_FID fanotify: copy event fid info to user fanotify: enable FAN_REPORT_FID init flag fanotify: support events with data type FSNOTIFY_EVENT_DENTRY fanotify: add support for create/attrib/move/delete events fanotify: report FAN_ONDIR to listener for filename events fs/notify/fanotify/fanotify.c | 199 ++++++++++++++++++++++++----- fs/notify/fanotify/fanotify.h | 76 ++++++++--- fs/notify/fanotify/fanotify_user.c | 131 ++++++++++++++++--- fs/statfs.c | 3 +- include/linux/fanotify.h | 31 ++++- include/linux/statfs.h | 3 + include/uapi/linux/fanotify.h | 45 ++++++- 7 files changed, 408 insertions(+), 80 deletions(-)