From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966376AbbD2Pz2 (ORCPT ); Wed, 29 Apr 2015 11:55:28 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51338 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966131AbbD2PzZ (ORCPT ); Wed, 29 Apr 2015 11:55:25 -0400 X-Sasl-enc: RGX+S5zH1T3IvVjlQHVCPtrdKYYZ03M4okEd/UvAddcl 1430322924 Date: Wed, 29 Apr 2015 17:55:22 +0200 From: Greg KH To: Beata Michalska Cc: Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, hughd@google.com, lczerner@redhat.com, hch@infradead.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, kyungmin.park@samsung.com, kmpark@infradead.org Subject: Re: [RFC v2 1/4] fs: Add generic file system event notifications Message-ID: <20150429155522.GA14723@kroah.com> References: <20150428135653.GD9955@quack.suse.cz> <20150428140936.GA13406@kroah.com> <553F9D56.6030301@samsung.com> <20150428173900.GA16708@kroah.com> <5540822C.10000@samsung.com> <20150429074259.GA31089@quack.suse.cz> <20150429091303.GA4090@kroah.com> <5540BC2A.8010504@samsung.com> <20150429134505.GB15398@kroah.com> <5540FD3E.9050801@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5540FD3E.9050801@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2015 at 05:48:14PM +0200, Beata Michalska wrote: > On 04/29/2015 03:45 PM, Greg KH wrote: > > On Wed, Apr 29, 2015 at 01:10:34PM +0200, Beata Michalska wrote: > >>>>> It needs to be done internally by the app but is doable. > >>>>> The app knows what it is watching, so it can maintain the mappings. > >>>>> So prior to activating the notifications it can call 'stat' on the mount point. > >>>>> Stat struct gives the 'st_dev' which is the device id. Same will be reported > >>>>> within the message payload (through major:minor numbers). So having this, > >>>>> the app is able to get any other information it needs. > >>>>> Note that the events refer to the file system as a whole and they may not > >>>>> necessarily have anything to do with the actual block device. > >>> > >>> How are you going to show an event for a filesystem that is made up of > >>> multiple block devices? > >> > >> AFAIK, for such filesystems there will be similar case with the anonymous > >> major:minor numbers - at least the btrfs is doing so. Not sure we can > >> differentiate here the actual block device. So in this case such events > >> serves merely as a hint for the userspace. > > > > "hint" seems like this isn't really going to work well. > > > > Do you have userspace code that can properly map this back to the "real" > > device that is causing problems? Without that, this doesn't seem all > > that useful as no one would be able to use those events. > > I'm not sure we are on the same page here. > This is about watching the file system rather than the 'real' device. > Like the threshold notifications: you would like to know when you > will be approaching certain level of available space for the tmpfs > mounted on /tmp. You do know you are watching the /tmp > and you know that the dev numbers for this are 0:20 (or so). > (either through calling stat on /tmp or through reading the /proc/$$/mountinfo) > With this interface you can setup threshold levels > for /tmp. Then, once the limit is reached the event will be > sent with those anonymous major:minor numbers. > > I can provide a sample code which will demonstrate how this > can be achieved. Yes, example code would be helpful to understand this, thanks. greg k-h