[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Optional mandatory locking

Optional mandatory locking

Posted Dec 16, 2015 14:45 UTC (Wed) by nix (subscriber, #2304)
In reply to: Optional mandatory locking by neilbrown
Parent article: Optional mandatory locking

One problem, of course, is that moving to that intermediate trust-but-verify scheme should really require something that is in some sense intermediate between that used by advisory locking and no-write-permission, so you could shift between them easily. Instead, you have simple code (advisory locking), a completely different *architecture* (a management daemon), and a local administrative tool (no write permission). Is there any wonder that people are annoyed by this dog's breakfast?

My dim memories of the days in the 90s when I tried to use mandatory locking are that it was similar to NFS in those days -- as in, any block was uninterruptible and unkillable. This essentially means that any bug (or attack from malevolent untrusted program, but this was the 90s, we weren't thinking in those terms so much) elevates a possible file corruption all the way up to oh-crap-I-have-to-reboot-and-even-that-might-not-work territory. Is there any wonder nobody went near mandatory locking after one look at that?


to post comments

Optional mandatory locking

Posted Dec 16, 2015 23:28 UTC (Wed) by neilbrown (subscriber, #359) [Link] (1 responses)

> One problem, of course, is that moving to that intermediate trust-but-verify scheme should really require something that is in some sense intermediate between that used by advisory locking and no-write-permission, so you could shift between them easily.

Nope. There is an enormous difference between co-operating processes and adversarial processes. Advisory locking is for friends that work together on a common goal and don't want to tread on each other's toes. IPC is for strangers with a contractual arrangement. They really are different scenarios and pretending you can drift smoothly from one to the other is a mistake.

I can agree that it would be nice if IPC were as easy as writing to a file, but I don't agree that you should be able to achieve IPC with minor modifications to code which is written to just write to a file.

Optional mandatory locking

Posted Dec 20, 2015 1:08 UTC (Sun) by nix (subscriber, #2304) [Link]

Hm, good point -- only, of course, the whole point of 'everything is an fd' and That Hideous Name was that you *should* be able to make major changes like that with as little churn as possible. I would be ever so happy if the VFS was general enough that it *was* the only IPC mechanism we needed. But that's not what we've got :(


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds