Kirill Kolyshkin: > The only way to make sure is to retry reading /proc/mounts. Or, do > stat+statfs > (exactly as you suggested below) to check that this is indeed the aufs root > directory (and then you still need to retry reading /proc/mounts).
Give me some more time about this topic. I will consider again. Your point is that the default value 1 for the new ProcMount_Times doesn't help you, right? > This is correct for read-write mounts, what about read-only ones? For this another topic, I have a plan to introduce a new local lock. Does this help you? commit 79235f42eca7a6290df1007ba786d3eb88f482e7 Author: J. R. Okajima <hooanon...@gmail.com> Date: Thu May 23 23:20:21 2019 +0900 aufs: bugfix, protect creating XINO from concurrent mounts 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, put it in a critical region. Obviously this is 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 way. Then why didn't I apply the same way to this au_xino_create()? It is just my laziness. Calling VFS filp_open() here is easy for me. Reported-by: Kirill Kolyshkin <kolysh...@gmail.com> Signed-off-by: J. R. Okajima <hooanon...@gmail.com> diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c index 74682b6a97eb..7de402b3bc34 100644 --- a/fs/aufs/xino.c +++ b/fs/aufs/xino.c @@ -153,16 +153,19 @@ struct file *au_xino_create(struct super_block *sb, char *fpath, int silent) struct dentry *h_parent, *d; struct inode *h_dir, *inode; int err; + static DEFINE_MUTEX(mtx); /* * at mount-time, and the xino file is the default path, * hnotify is disabled so we have no notify events to ignore. * when a user specified the xino, we cannot get au_hdir to be ignored. */ + mutex_lock(&mtx); file = vfsub_filp_open(fpath, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE /* | __FMODE_NONOTIFY */, 0666); if (IS_ERR(file)) { + mutex_unlock(&mtx); if (!silent) pr_err("open %s(%ld)\n", fpath, PTR_ERR(file)); return file; @@ -172,6 +175,7 @@ struct file *au_xino_create(struct super_block *sb, char *fpath, int silent) err = 0; d = file->f_path.dentry; h_parent = au_dget_parent_lock(d, AuLsc_I_PARENT); + mutex_unlock(&mtx); /* mnt_want_write() is unnecessary here */ h_dir = d_inode(h_parent); inode = file_inode(file);