[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080214161942.55ce5089@dilbert.local>
Date: Thu, 14 Feb 2008 16:19:42 +0100
From: Hans-Jürgen Koch <hjk@...utronix.de>
To: Jan Engelhardt <jengelh@...putergmbh.de>
Cc: Andi Kleen <andi@...stfloor.org>,
Jasper Bryant-Greene <jasper@...x.geek.nz>,
rzryyvzy <rzryyvzy@...shmail.net>, linux-kernel@...r.kernel.org
Subject: Re: Is there a "blackhole" /dev/null directory?
Am Thu, 14 Feb 2008 16:00:06 +0100 (CET)
schrieb Jan Engelhardt <jengelh@...putergmbh.de>:
>
> On Feb 14 2008 10:46, Andi Kleen wrote:
> >Jasper Bryant-Greene <jasper@...x.geek.nz> writes:
> >>
> >> This could be done fairly trivially with FUSE, and IMHO is a good
> >> use for FUSE because since you're just throwing most data away,
> >> performance is not a concern.
>
> There is a much more interesting 'problem' with a "/dev/null
> directory".
>
> Q: Why would you need such a directory?
> A: To temporarily fool a program into believing it wrote something.
>
> Q: Should all files disappear? (e.g. "unlink after open")
> A: Maybe not, programs may stat() the file right afterwards and
> get confused by the "inexistence".
>
> Q: What if a program attempts to mkdir /dev/nullmnt/foo to just
> create a file /dev/nullmnt/foo/barfile?
> A: /dev/nullmnt/foo must continue to exist or be accepted for a while,
> or perhaps for eternity.
Well, the problem seems to be that a "directory" is not just data but
also contains metadata. While it's easy to write data to /dev/null, you
cannot simply discard metadata associated with a directory. So, such a
"/dev/null-directory" would have to remember metadata (at least all
created filenames including subdirectories) in the same way as other
filesystems do. Only file _content_ can be discarded.
To be honest, I still cannot see many sensible usecases for that...
Thanks,
Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists