TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rethinking the filesystem as global mutable state, the root of all evil

103 pointsby stargravealmost 6 years ago

13 comments

mrfredwardalmost 6 years ago
Every piece of hardware on a computer is a piece of global mutable state. There are many good reasons to hide that fact behind an abstraction, but I can&#x27;t help but think hiding global mutability is better handled at the application level than the OS level, because there are too many cases where the abstraction becomes extremely limiting.<p>As an example, most people would want to be able to import an image into a word processor regardless of where that image is located (local drive, network drive, floppy disk, etc.). To support that, most end user programs would want to be offered access to the entire filesystem. The moment two applications do this at once, you have all the shared mutable state problems we do now.
评论 #20155999 未加载
评论 #20156642 未加载
评论 #20156827 未加载
评论 #20159586 未加载
naaskingalmost 6 years ago
This was first explained by the capability security community. Plan 9&#x27;s private nameapaces is an approach to capability secure file systems, with the default being the empty namespace. I&#x27;m surprised the article didn&#x27;t mention Plan 9 actually since it discusses capabilities.
评论 #20156149 未加载
评论 #20155388 未加载
JoeAltmaieralmost 6 years ago
I&#x27;ve thought for years that &#x27;file systems&#x27; are an abomination. We use a cobbled-together schema of parent-directory, filename, some random date&#x2F;time stamps and maybe a three-letter extension. Why? Because we inheirited that from some DOS days.<p>Why not a collection of immutable UUID-labelled resources with an arbitrary schema of attributes? Like a relational database or some such.<p>Overkill? Doesn&#x27;t every major app have to do this itself, in some container (document&#x2F;mail folder&#x2F;image definition&#x2F;contact list and on and on)?<p>Designers of operating systems have made no effort to capture this kind of service and provide it as a fundamental OS feature. And OSs are exactly where this belongs - where you can carefully get it right and everybody writing apps can depend on it.
评论 #20157468 未加载
评论 #20157101 未加载
评论 #20157918 未加载
评论 #20157613 未加载
pjc50almost 6 years ago
Interesting, and should definitely be read with the companion <a href="https:&#x2F;&#x2F;www.devever.net&#x2F;~hl&#x2F;objectworld" rel="nofollow">https:&#x2F;&#x2F;www.devever.net&#x2F;~hl&#x2F;objectworld</a><p>Given the same title, I would write a rather different article. So many of our traditional filesystem problems center around concurrency: what kind of read-after-write or durability semantics are guaranteed. A lot of effort goes into this, which is necessary for databases to work on top of a general-purpose filesystem on top of a disintermediated storage system that may be a disk or SSD with a variety of block sizes. But for most operations it&#x27;s unnecessary overhead.<p>Many games ship with a &quot;packfile&quot;, which is a pseudo-filesystem that appears as a giant blob to the OS. Usually it&#x27;s faster to seek individual small items out of the blob than if they were separate files.<p>Further to that is the security problem; we&#x27;ve moved from &quot;apps are all trusted, but you need to watch the files closely between multiple users&quot; to &quot;there&#x27;s only one user, but you can&#x27;t trust the apps&quot;.<p>Note how the cloud has avoided both of these by moving storage to three different areas with different semantics. Apps can speak to &quot;blob storage&quot; (S3) which has a transactionality&#x2F;security granularity of one blob. Or they can speak to a database (which has intelligence of its own), or separate raw block storage if neither of those suits.<p>What if we moved from &quot;everything is a file&quot; to &quot;everything is a URL&quot;? Possibly adding a system-default packfile mechanism. So an app would be allowed access to everything that it ships with, but nothing outside except what it could request as URLs with various sorts of security mechanism.
评论 #20157255 未加载
评论 #20156760 未加载
评论 #20157679 未加载
评论 #20156420 未加载
mnw21camalmost 6 years ago
As anyone who has put together a chroot knows, it isn&#x27;t as simple as just preventing a process from accessing the filesystem. Most programs <i>need</i> to access <i>a</i> filesystem, just so they can load libc and the various other libraries it might need.
评论 #20155718 未加载
评论 #20157327 未加载
评论 #20157199 未加载
gugagorealmost 6 years ago
One thing missing from this rethinking, as far as I can tell, is names.<p>You can&#x27;t move pointers between different processes in general, because each process has its own &quot;memory address namespace&quot;. But an absolute path generated by one program does make sense to another program.
评论 #20157354 未加载
perlgeekalmost 6 years ago
This is a fascinating idea, and totally obvious in retrospect :-)<p>I&#x27;ve noticed features that work towards cutting off access from global file system. Containers are mentioned in the article, but there are other things like systemd giving easy access to per-service private temp files, blocking access to &#x2F;home, whitelisting paths that are allowed at all etc.<p>The problem really is that this global mutable state has existed for 50+ years, so lots and lots of things now rely on it: dynamic loading of libraries (could be separate objects from files), configuration (doesn&#x27;t need to be stored in files), UNIX sockets that are accessed by file name etc.<p>And not only have many programs started to rely on files, but many have relied on them being mutable. Webservers can be told to re-read their config from a running process, things like that.<p>So, is there any way forward for UNIX-based systems that don&#x27;t break the world?<p>Edit: another interesting observation is that iOS has already done away with the global file system, at least from the perspective of the apps.
specialpalmost 6 years ago
Web assembly is a good step in the elimination of the globally shared FS. Dynamically linked libraries are explicitly provided with an index only that links to the library location. <a href="https:&#x2F;&#x2F;webassembly.org&#x2F;docs&#x2F;dynamic-linking&#x2F;" rel="nofollow">https:&#x2F;&#x2F;webassembly.org&#x2F;docs&#x2F;dynamic-linking&#x2F;</a><p>WASI <a href="https:&#x2F;&#x2F;hacks.mozilla.org&#x2F;2019&#x2F;03&#x2F;standardizing-wasi-a-webassembly-system-interface&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hacks.mozilla.org&#x2F;2019&#x2F;03&#x2F;standardizing-wasi-a-webas...</a> will provide access to files given to the function by the runtime, not vice versa as in operating systems where a syscall is sent to ask permission for a file.
x3roalmost 6 years ago
This reminded me of this [1] talk from 32c3, which talks about the same issues and presents and overview of some approaches ppl have come up with. Somewhat BSD centric, but I found it interesting back then.<p>[1]: <a href="https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;32c3-7231-cloudabi" rel="nofollow">https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;32c3-7231-cloudabi</a>
skdotdanalmost 6 years ago
One thing that has always astounded me is the fact that the following script can be executed without any special permission (apart from execution, read and write):<p><pre><code> rm -rf ~ </code></pre> A key to a more modern file system would be a much more granular permission systems apart from &quot;rwx&quot; for a certain group of users.
评论 #20165315 未加载
ncmncmalmost 6 years ago
This is a very important idea, but it will take a long time to become practical for typical system design environments.<p>Best get started.
asimpletunealmost 6 years ago
Isn’t this sort of how sandboxing iOS apps already feels like?
pfdietzalmost 6 years ago
&gt; root of all evil<p>I see what you did there.