• J. R. Okajima's avatar
    aufs: bugfix, protect creating XINO from concurrent mounts · abf61326
    J. R. Okajima authored
    
    
    At the mount-time, XINO files are created and removed very soon.  When
    multiple mounts with being given the same XINO file path executed in
    parallel, some of them may fail in creating XINO due to EEXIST.
    Introducing a local mutex, make it serialized.
    By default, XINO is created at the top dir of the first writable
    branch.  In this case, the new mutex won't be used.
    
    Obviously this is an unnecessary overhead when the XINO file path is not
    same, and such lock should be done by inode_lock() for the parent dir.
    Actually au_xino_create2() behaves in this manner.  Then why didn't I
    apply the same way to this au_xino_create()?  It is just because of my
    laziness.  Calling VFS filp_open() here is easy for me.
    Reported-by: default avatarKirill Kolyshkin <kolyshkin@gmail.com>
    Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
    (cherry picked from commit 30d9273f2a1ce331b1a79b770bdb4c493919a673)
    abf61326
xino.c 41.4 KB