From patchwork Thu Jan 10 17:04:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10756261 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 7BF2F13B4 for ; Thu, 10 Jan 2019 17:04:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65D9F29AC2 for ; Thu, 10 Jan 2019 17:04:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57C1E29B55; Thu, 10 Jan 2019 17:04:56 +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 E79D329AC2 for ; Thu, 10 Jan 2019 17:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728929AbfAJREy (ORCPT ); Thu, 10 Jan 2019 12:04:54 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:36316 "EHLO mail-wr1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728266AbfAJREy (ORCPT ); Thu, 10 Jan 2019 12:04:54 -0500 Received: by mail-wr1-f41.google.com with SMTP id u4so12243662wrp.3; Thu, 10 Jan 2019 09:04: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=ft7N4THkOn/OgEyJeUKNxlw19S2x3Qjq/zIggFsv1R8=; b=tBgunokESmTwy/VJU37jXof8nOR9VYhbK5iWeO1YUlEx2NFW9enKChcekmj/WAB59n iq1LP6eBzKg+IyfFTmhNJPNTwhl/GaCaDzZfNIrtMPd24RJbx+qlvAfw+KgjFsFjb758 3qGh7Kt9kfupR5bWxLc9yZBrTAD+umtOPyWossku/2e1eONryTvvKyidObPkbQ14DbOa lzeKbqBQdySWSL8Vm6V+DeKLYKGsOCoa7q1hUcQbcw1mw4mK/KIi015PXtk3eQAXZVCC cBA37kJnH3QZBTrYr/exGvtpCOogRIGIKLjgOvJ08zxbgjrOz6GJpdj2klnVb13ufLX2 1OIA== 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=ft7N4THkOn/OgEyJeUKNxlw19S2x3Qjq/zIggFsv1R8=; b=fhcsd2QvYyIlNyImYnb0es24Zza4ao/tdMPlZARVJMX6db2VWFwDRaDOaju4rBbSuu bpGW1sj1nL8S1p6pC6eGK9rpTSgvyUBmC5vOFMBUXwHvLKxSIN1sQS4G/s5FNrkROEIK MxsRlSy+dYEz+vkSc4lHy/yrZvZjiBg5aJtb513pePQvAzruwSaghXEEkcVp4hYimMZf qdrLI1XClz0cGcwv60FNdOR2KJjqFW6h5MEpfTRu9HF8UDp9D/WQ7s7VkEBWUjr9Im8r zTUfpL46KryWskvRI84NtjCt4NoejLSiDZ+5DN1Nu1a2ezYgA4vNuWG0ig9qLe9Vb9jO HvEA== X-Gm-Message-State: AJcUukdNQmlMSOByY1KdkABYsRZTtHt5jMih2TgK8eB8Y+Jr9GnIQ/hn l0pBv5cSKzeR8z8SxCcZZuld0UMj X-Google-Smtp-Source: ALg8bN4/GcDDnSHGtMtlPi/gk19hJR+oz6VgWhEJ1RGbb8DWCWDrn+a2YPJlMfKwYrct2HoF4kuewQ== X-Received: by 2002:adf:9ec8:: with SMTP id b8mr10477849wrf.164.1547139892094; Thu, 10 Jan 2019 09:04:52 -0800 (PST) Received: from amir-VirtualBox.ctera.local ([188.120.129.201]) by smtp.gmail.com with ESMTPSA id m4sm5725868wmi.3.2019.01.10.09.04.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 09:04:51 -0800 (PST) From: Amir Goldstein To: Jan Kara Cc: Matthew Bobrowski , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH v5 00/17] fanotify: add support for more event types Date: Thu, 10 Jan 2019 19:04:27 +0200 Message-Id: <20190110170444.30616-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 5th revision of patch series to add support for filesystem change monitoring to fanotify. The complete work is available on fanotify_dirent-v5 branch [1] on github. LTP tests by Matthew Bobrowski for FAN_REPORT_FID are available on my LTP branch fanotify_fid [2]. A WIP test for dirent events is available on my LTP branch fanotify_dirent [3]. Matthew Bobrowski is working on a proper test for dirent events and on man pages for both FAN_REPORT_FID and dirent events (Thanks!). The combined functionality of FAN_MARK_FILESYSTEM, FAN_REPORT_FID and dirent modification events is demonstrated with a prototype of global filesystem monitor based on inotify-tools [4]. Thanks, Amir. Changes since v4: - Rebase on v5.0-rc1 - Address style review comments on v4 - info_len includes padding to info_hdr alignment - handle caching of fsid correctly when inotify marks on object exist - Report dirent events on subdirs only with FAN_ONDIR - Report XXX_SELF events on directories only with FAN_ONDIR - Do not merge dirent events on subdirs with dirent events on non subdirs [1] https://github.com/amir73il/linux/commits/fanotify_dirent-v5 [2] https://github.com/amir73il/ltp/commits/fanotify_fid [3] https://github.com/amir73il/ltp/commits/fanotify_dirent [4] https://github.com/amir73il/inotify-tools/commits/fanotify_dirent Amir Goldstein (17): fsnotify: annotate directory entry modification events fsnotify: remove dirent events from FS_EVENTS_POSS_ON_CHILD mask fsnotify: send all event types to super block marks fsnotify: move mask out of struct fsnotify_event fanotify: rename struct fanotify_{,perm_}event_info fanotify: open code fill_event_metadata() fanotify: encode file identifier for FAN_REPORT_FID fanotify: copy event fid info to user fanotify: enable FAN_REPORT_FID init flag fanotify: cache fsid in fsnotify_mark_connector vfs: add vfs_get_fsid() helper fanotify: use vfs_get_fsid() helper instead of vfs_statfs() fsnotify: report FS_ISDIR flag with MOVE_SELF and DELETE_SELF events fanotify: check FS_ISDIR flag instead of d_is_dir() fanotify: support events with data type FSNOTIFY_EVENT_INODE fanotify: add support for create/attrib/move/delete events fanotify: report FAN_ONDIR to listener with FAN_REPORT_FID fs/notify/fanotify/fanotify.c | 229 +++++++++++++++++---- fs/notify/fanotify/fanotify.h | 105 ++++++++-- fs/notify/fanotify/fanotify_user.c | 288 +++++++++++++++++++-------- fs/notify/fsnotify.c | 15 +- fs/notify/inotify/inotify.h | 1 + fs/notify/inotify/inotify_fsnotify.c | 18 +- fs/notify/inotify/inotify_user.c | 5 +- fs/notify/mark.c | 47 ++++- fs/notify/notification.c | 22 +- fs/statfs.c | 14 ++ include/linux/fanotify.h | 26 ++- include/linux/fsnotify.h | 94 +++++++-- include/linux/fsnotify_backend.h | 70 ++++--- include/linux/statfs.h | 3 + include/uapi/linux/fanotify.h | 29 +++ 15 files changed, 753 insertions(+), 213 deletions(-)