From: Greg KH <greg@kroah.com>
To: Beata Michalska <b.michalska@samsung.com>
Cc: Jan Kara <jack@suse.cz>,
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
Date: Wed, 29 Apr 2015 17:55:22 +0200 [thread overview]
Message-ID: <20150429155522.GA14723@kroah.com> (raw)
In-Reply-To: <5540FD3E.9050801@samsung.com>
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
next prev parent reply other threads:[~2015-04-29 15:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-27 11:51 [RFC v2 0/4] fs: Add generic file system event notifications Beata Michalska
2015-04-27 11:51 ` [RFC v2 1/4] " Beata Michalska
2015-04-27 14:24 ` Greg KH
2015-04-27 15:08 ` Beata Michalska
2015-04-27 15:37 ` Greg KH
2015-04-28 9:05 ` Beata Michalska
2015-04-28 13:56 ` Jan Kara
2015-04-28 14:09 ` Greg KH
2015-04-28 14:46 ` Beata Michalska
2015-04-28 17:39 ` Greg KH
2015-04-29 7:03 ` Beata Michalska
2015-04-29 7:42 ` Jan Kara
2015-04-29 9:13 ` Greg KH
2015-04-29 11:10 ` Beata Michalska
2015-04-29 13:45 ` Greg KH
2015-04-29 15:48 ` Beata Michalska
2015-04-29 15:55 ` Greg KH [this message]
2015-04-30 8:21 ` Beata Michalska
2015-05-05 12:16 ` Beata Michalska
2015-05-07 11:57 ` Beata Michalska
2015-05-26 16:39 ` Beata Michalska
2015-05-27 2:34 ` Greg KH
2015-05-27 13:32 ` Beata Michalska
2015-04-27 11:51 ` [RFC v2 2/4] ext4: Add helper function to mark group as corrupted Beata Michalska
2015-04-27 11:51 ` [RFC v2 3/4] ext4: Add support for generic FS events Beata Michalska
2015-04-27 11:51 ` [RFC v2 4/4] shmem: " Beata Michalska
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150429155522.GA14723@kroah.com \
--to=greg@kroah.com \
--cc=adilger.kernel@dilger.ca \
--cc=b.michalska@samsung.com \
--cc=hch@infradead.org \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=kmpark@infradead.org \
--cc=kyungmin.park@samsung.com \
--cc=lczerner@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).