Klaus Knopper:
> Yes. Sorry, I was unaware of aufs-utils having a kernel version
> dependency, but considering it uses ioctls, it's understandable. I have
> not upgraded aufs-utils in a while, frankly, because I never used it.
> Knoppix uses aufs as compiled-in file system via mount, with the noplink
> option, so I did not run into problems with synchronizing on
> umount/shutdown.

I see.
Then I guess Michael will succeed too if he specifies noplink option.


> I'd say you are over-careful here. A user that specifies an important
> file as target to the xino= option is unlikely to blame you for killing
> a file that he actually just specified by himself as target for
> destruction, the same way as he would not blame "rm" for not asking "Do
> you REALLY want to remove this file?" without the -i option. Anyways,
> it's your design decision, you are the author, and I think you have
> documented the behaviour well enough. :-)

My example of "rm and an important file" was not good.
Here I try explaining why O_EXCL for xino is necessary.

- user may mount two aufs-es concurrently (and aufs doesn't want to
  prohibit it).
- if he specify "xino=/same/xino/path" for both aufs mounts, then it may run
  like this without O_EXCL.
  + both operations issue open("/same/xino/path", O_CREAT | O_TRUNC) and
    succeed.
  + as a result, both aufs mounts refers the same xino file.
- then, one of them writes info to the xino file, and the other refers
  it. It is totally wrong and breaks aufs inode consistency.

This is a generic problem why O_EXCL is necessary.
Strictly speaking, aufs doesn't issue open(2) since aufs is a kernel
module. But the internal operation to open the specified xino file is
equivalent to the open(2) systemcall essentially.
So O_EXCL is absolutely necessary for xino file, and in such case,
EEXIST should be returned.


J. R. Okajima

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure

Reply via email to