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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 97671C28CC3 for ; Thu, 30 May 2019 11:00:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B9AA257AC for ; Thu, 30 May 2019 11:00:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfE3LAa (ORCPT ); Thu, 30 May 2019 07:00:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:50354 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726359AbfE3LA3 (ORCPT ); Thu, 30 May 2019 07:00:29 -0400 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 8A629AEB8; Thu, 30 May 2019 11:00:27 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 928B31E3C08; Thu, 30 May 2019 13:00:24 +0200 (CEST) Date: Thu, 30 May 2019 13:00:24 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , David Howells , Al Viro , Ian Kent , linux-fsdevel , linux-api@vger.kernel.org, linux-block , keyrings@vger.kernel.org, LSM List , linux-kernel Subject: Re: [RFC][PATCH 0/7] Mount, FS, Block and Keyrings notifications Message-ID: <20190530110024.GB29237@quack2.suse.cz> References: <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <20190529142504.GC32147@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed 29-05-19 18:53:21, Amir Goldstein wrote: > > > David, > > > > > > I am interested to know how you envision filesystem notifications would > > > look with this interface. > > > > > > fanotify can certainly benefit from providing a ring buffer interface to read > > > events. > > > > > > From what I have seen, a common practice of users is to monitor mounts > > > (somehow) and place FAN_MARK_MOUNT fanotify watches dynamically. > > > It'd be good if those users can use a single watch mechanism/API for > > > watching the mount namespace and filesystem events within mounts. > > > > > > A similar usability concern is with sb_notify and FAN_MARK_FILESYSTEM. > > > It provides users with two complete different mechanisms to watch error > > > and filesystem events. That is generally not a good thing to have. > > > > > > I am not asking that you implement fs_notify() before merging sb_notify() > > > and I understand that you have a use case for sb_notify(). > > > I am asking that you show me the path towards a unified API (how a > > > typical program would look like), so that we know before merging your > > > new API that it could be extended to accommodate fsnotify events > > > where the final result will look wholesome to users. > > > > Are you sure we want to combine notification about file changes etc. with > > administrator-type notifications about the filesystem? To me these two > > sound like rather different (although sometimes related) things. > > > > Well I am sure that ring buffer for fanotify events would be useful, so > seeing that David is proposing a generic notification mechanism, I wanted > to know how that mechanism could best share infrastructure with fsnotify. > > But apart from that I foresee the questions from users about why the > mount notification API and filesystem events API do not have better > integration. > > The way I see it, the notification queue can serve several classes > of notifications and fsnotify could be one of those classes > (at least FAN_CLASS_NOTIF fits nicely to the model). I agree that for some type of fsnotify uses a ring buffer would make sense. But for others - such as permission events or unlimited queues - you cannot really use the ring buffer and I don't like the idea of having different ways of passing fsnotify events to userspace based on notification group type... Honza -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Date: Thu, 30 May 2019 11:00:24 +0000 Subject: Re: [RFC][PATCH 0/7] Mount, FS, Block and Keyrings notifications Message-Id: <20190530110024.GB29237@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <20190529142504.GC32147@quack2.suse.cz> In-Reply-To: To: Amir Goldstein Cc: Jan Kara , David Howells , Al Viro , Ian Kent , linux-fsdevel , linux-api@vger.kernel.org, linux-block , keyrings@vger.kernel.org, LSM List , linux-kernel On Wed 29-05-19 18:53:21, Amir Goldstein wrote: > > > David, > > > > > > I am interested to know how you envision filesystem notifications would > > > look with this interface. > > > > > > fanotify can certainly benefit from providing a ring buffer interface to read > > > events. > > > > > > From what I have seen, a common practice of users is to monitor mounts > > > (somehow) and place FAN_MARK_MOUNT fanotify watches dynamically. > > > It'd be good if those users can use a single watch mechanism/API for > > > watching the mount namespace and filesystem events within mounts. > > > > > > A similar usability concern is with sb_notify and FAN_MARK_FILESYSTEM. > > > It provides users with two complete different mechanisms to watch error > > > and filesystem events. That is generally not a good thing to have. > > > > > > I am not asking that you implement fs_notify() before merging sb_notify() > > > and I understand that you have a use case for sb_notify(). > > > I am asking that you show me the path towards a unified API (how a > > > typical program would look like), so that we know before merging your > > > new API that it could be extended to accommodate fsnotify events > > > where the final result will look wholesome to users. > > > > Are you sure we want to combine notification about file changes etc. with > > administrator-type notifications about the filesystem? To me these two > > sound like rather different (although sometimes related) things. > > > > Well I am sure that ring buffer for fanotify events would be useful, so > seeing that David is proposing a generic notification mechanism, I wanted > to know how that mechanism could best share infrastructure with fsnotify. > > But apart from that I foresee the questions from users about why the > mount notification API and filesystem events API do not have better > integration. > > The way I see it, the notification queue can serve several classes > of notifications and fsnotify could be one of those classes > (at least FAN_CLASS_NOTIF fits nicely to the model). I agree that for some type of fsnotify uses a ring buffer would make sense. But for others - such as permission events or unlimited queues - you cannot really use the ring buffer and I don't like the idea of having different ways of passing fsnotify events to userspace based on notification group type... Honza -- Jan Kara SUSE Labs, CR