Re: Idea: mount /tmp to tmpfs depending on free space and RAM
- To: firstname.lastname@example.org
- Subject: Re: Idea: mount /tmp to tmpfs depending on free space and RAM
- From: Aneurin Price <email@example.com>
- Date: Mon, 11 Jun 2012 15:52:37 +0100
- Message-id: <CAHb+SPBATxEtBxzqe7p4HD+Du=uz3DHAL0MSCcxca0MCOzSzfirstname.lastname@example.org>
- In-reply-to: <1339423495.4245.209.camel@pi0307572>
- References: <CAOVenEp6C0QF+K3OLw_jLYkza9qSGd8du4LBrAayp1SM9WaG7w@mail.gmail.com> <email@example.com> <CAOVenEpy-zwzyKB7MYsGb=xCB6sBPAKD6uyDDVRF9GnrZ1=oAw@mail.gmail.com> <20120607132408.GI21618@grep.be> <firstname.lastname@example.org> <email@example.com> <CAHb+SPBD-t34i_z6o=MG0SK9J2QuRGA1kzvjtODeS73W5U47jg@mail.gmail.com> <1339423495.4245.209.camel@pi0307572>
On 11 June 2012 15:04, Josselin Mouette <firstname.lastname@example.org> wrote:
> Le lundi 11 juin 2012 à 14:53 +0100, Aneurin Price a écrit :
>> On 8 June 2012 12:04, Bjørn Mork <email@example.com> wrote:
>> > Any file system will run out of space given the broken applications
>> > mentioned in this thread.
>> It is not productive to redefine applications as 'broken' simply
>> because they do not conform to an arbitrary set of requirements that
>> you have just added, especially when you haven't even given any
>> indication of what you consider 'non-broken' behaviour.
> So your applications are not broken because they all have access to
> infinite storage?
> Your life must be so fantastic.
(Note that we are talking about applications which fail gracefully
when confronted with ENOSPC, but which are likely to do so more often
when the size of /tmp is restricted.)
In general, my applications assume that temporary files can be stored
in /tmp unless configured otherwise.
It would be possible of course for all applications to be enhanced to
look at the size of the data they may need to store, such that files
of (say) 1GB could be treated differently to files of 1kB. I'm not
sure what would happen in the case that the size is unknown to start
with, although perhaps it would be safest to assume that the size will
grow without bound (though of course this is likely to be untrue in
reality, unless perhaps the application is naively decompressing a
maliciously crafted archive).
It's not clear though what would be the preferred behaviour -
traditionally the best location for temporary files has always been
/tmp regardless of the size of those files, so applications being so
enhanced would need to come up with some new policy. It's this part
which is missing from the claims of brokenness - no indication of what
the claimant would consider 'correct'.
Furthermore, it's also not clear what the benefit would be - this
amounts to the conversion of essentially one line of code (in an
unknown but potentially large set of applications) into a fair bit
more, increasing the chance of bugs, to solve a problem which has not
existed in practice until now.
Your exaggeration of 'infinite storage' is disingenuous - in practice
it is an entirely reasonable assumption that an application operating
on a file will have *enough* storage to do so, as this has been the
case on all mainstream desktop systems for over a decade - bearing in
mind that mainstream desktop systems are exactly the ones which should
be targetted by *default* options. If it really doesn't have enough
storage, then what is the application supposed to do better? But if
the system really does have that space, but apportioned in such a way
that the application cannot use it when it needs to, then it is the
system which is at fault, not the application for not working out some
new implied but unspecified policy.