Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3450969ybd; Fri, 28 Jun 2019 08:51:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyr91o9WV1+ct4JW/eWM7fJRxaPGvtVTqyAKDRFLBbdMANuLIqM5rszKpCxWN9DKQsdEvsv X-Received: by 2002:a17:90a:20a2:: with SMTP id f31mr13940192pjg.90.1561737085216; Fri, 28 Jun 2019 08:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561737085; cv=none; d=google.com; s=arc-20160816; b=JqV0f5S3hqRLLB4fBYBKRRPu96Q2D+os+leDaAY+VzFwDUnvEVpUPUI7gsqW2XSt8N 5kvXSTw71FJIJdsbGRSjc8gJjUxfteSrlkeyqOr5eYzHeWZAPBkdfH/m+4DUUDXuHrBx KdwpN0mIXy0/gUjQuShaJcg45dq9KZ61l12Ga3EHKH0RRX247RjDRbF1oxAqNLLzkcyh xzmq8gVjUgLADJ/2C/7kMumD8oDd3it8swWJlRierVtg0GwH0cPxUa/dWKlTNfxHxw6f JRPWgmqiCFL+LzxbJkmm0p0SbvYUveYAXh4kH9Agxr8PgCnsIK9debnBSGz1/IAen5Ef A9Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization; bh=Q1z8u6u6jgn6sc3uobZScL0WwB3PB6LjDuTPR3gYcx8=; b=KwfJSNF06GAwN/1Q/eEBEAeUIBdu6u0IOr0oukLm1rl46DcepS0EfjbcDaigRAYYkJ GdVpyRoBLfpvbm35d7F0uoNZkVOYWMX3/C1WI8Pj5uEDrGt/azyqyz1ruZasisQE6wyp zfYowdwVlS3aWbobErqi6gEN8wTbfoEUZP2RtbcHIrK8mzR0dKzBzLd6GnZ4nBn+FaAF /fE7AtZU1KMHFSp365j9UoDJ0f/NNUwlwblLzWkH5ydkKJtFEcZk1a1hA2NKXMMkxMLQ zdHnPNOksjCELFk7yM7o/9eds9CJde20GlgjhX26n5qBjJsN2VatQoqLF/wZuBlulwcy kj+w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si2699894pfa.248.2019.06.28.08.51.09; Fri, 28 Jun 2019 08:51:25 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727502AbfF1Puk (ORCPT + 99 others); Fri, 28 Jun 2019 11:50:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727219AbfF1Puj (ORCPT ); Fri, 28 Jun 2019 11:50:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E9FDE30832D8; Fri, 28 Jun 2019 15:50:38 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-219.rdu2.redhat.com [10.10.120.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id 404FD6013A; Fri, 28 Jun 2019 15:50:36 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 2/6] Adjust watch_queue documentation to mention mount and superblock watches. [ver #5] From: David Howells To: viro@zeniv.linux.org.uk Cc: dhowells@redhat.com, Casey Schaufler , Stephen Smalley , Greg Kroah-Hartman , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , dhowells@redhat.com, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 28 Jun 2019 16:50:35 +0100 Message-ID: <156173703546.15650.14319137940607993268.stgit@warthog.procyon.org.uk> In-Reply-To: <156173701358.15650.8735203424342507015.stgit@warthog.procyon.org.uk> References: <156173701358.15650.8735203424342507015.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 28 Jun 2019 15:50:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: David Howells --- Documentation/watch_queue.rst | 20 +++++++++++++++++++- drivers/misc/Kconfig | 5 +++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Documentation/watch_queue.rst b/Documentation/watch_queue.rst index 4087a8e670a8..1bec2018d549 100644 --- a/Documentation/watch_queue.rst +++ b/Documentation/watch_queue.rst @@ -13,6 +13,10 @@ receive notifications from the kernel. This can be used in conjunction with:: * USB subsystem event notifications + * Mount topology change notifications + + * Superblock event notifications + The notifications buffers can be enabled by: @@ -324,6 +328,19 @@ Any particular buffer can be fed from multiple sources. Sources include: for buses and devices. Watchpoints of this type are set on the global device watch list. + * WATCH_TYPE_MOUNT_NOTIFY + + Notifications of this type indicate mount tree topology changes and mount + attribute changes. A watch can be set on a particular file or directory + and notifications from the path subtree rooted at that point will be + intercepted. + + * WATCH_TYPE_SB_NOTIFY + + Notifications of this type indicate superblock events, such as quota limits + being hit, I/O errors being produced or network server loss/reconnection. + Watches of this type are set directly on superblocks. + Event Filtering =============== @@ -365,7 +382,8 @@ Where: (watch.info & info_mask) == info_filter This could be used, for example, to ignore events that are not exactly on - the watched point in a mount tree. + the watched point in a mount tree by specifying NOTIFY_MOUNT_IN_SUBTREE + must be 0. * ``subtype_filter`` is a bitmask indicating the subtypes that are of interest. Bit 0 of subtype_filter[0] corresponds to subtype 0, bit 1 to diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index e53f88783fe7..8b13103b17c0 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -11,8 +11,9 @@ config WATCH_QUEUE help This is a general notification queue for the kernel to pass events to userspace through a mmap()'able ring buffer. It can be used in - conjunction with watches for key/keyring change notifications and device - notifications. + conjunction with watches for key/keyring change notifications, device + notifications, mount topology change notifications, and superblock + change notifications. Note that in theory this should work fine with NOMMU, but I'm not sure how to make that work.