Re: [BUG] Using inotify on /proc/partitoins

From: Al Viro
Date: Thu Jun 13 2013 - 22:05:35 EST

On Fri, Jun 14, 2013 at 09:26:49AM +0800, majianpeng wrote:
> Hi all,
> I wanted to monitor /proc/partitions using inotify.

That, indeed, is a bug. Easily fixed - don't do that.

> But when i call 'cat /proc/partitions',the program can't return.
> So i added some message in kernel in order to find the reason.
> In procfs for some files, the inode used this method to alloc.
> proc_lookup-->proc_lookup_de--->proc_get_inode-->new_inode_pseudo
> In new_inode_pseudo, it will alloc new inode so every open-operation procfs will alloc new inode.
> So inotify can't work.

Of course, it can't work. Inotify if a kludge that kinda-sorta works
for local disk-backed filesystems, if you do not mind a pile of races.
For anything else it's completely worthless.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at