tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: exact semantics of union mounts (and TRYEMULROOT)



>> So I think we need to test all layers before creating anything.
> Of course.

Well...if there's a whiteout (at any layer), you need not look at
layers below it, I think.

> Just consider it as link+unlink (and keep the locking to make it
> idempotent, which tends to be the complex part...)

I think you are actually talking about atomicity, not idempotency.
rename() is idempotent, but only because rename()ing a nonexistent file
does nothing.  ("Idempotent" = "can be done multiple times with the
same effect as being done once".)  What's important, I think, is that
it be atomic, that is, no other operation can ever see a partially-done
rename().

There is also the promise that, if the destination existed before the
operation, there is no circumstance, even involving a crash, where the
destination doesn't exist after.  But, if the system stays up
throughout, that is covered by atomicity; it's really relevant only in
case of a crash, and then can be only a best-effort attempt, since
crashes can involve arbitrary corruption of just about anything.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index