Re: /proc dubious hack?

Bill Hawes (whawes@star.net)
Wed, 21 Jan 1998 16:23:02 -0500


Chris Evans wrote:

> > In the case of /proc, where would an inode be written? The problem with
> > a synthetic filesystem is that the objects may not have a persistant
> > representation.
>
> The problem is the code used to monitor _attempted_ changes to inodes (eg.
> permissions) in proc_write_inode. This used to be called even if it did
> nothing. Now it no longer is. The inode get forcibly set n_link = 0 on
> iput before the VFS notices it's dirty and calls the procfs write_inode
> hook :-(

Well, conceivably the proc_put_inode code could check for dirty inodes
and write them out directly. You'd need to check to be sure that the
operations don't block though; at that point the inode is still hashed
and could be reused.

Also note that if some /proc entries weren't volatile and it actually
made sense to keep the inodes around, we could define a persistant flag
and not dispose of the inode. But for most cases it doesn't make sense
to keep the old inode.

Regards,
Bill