[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegtoO6wub5+diEhiVfUmj+ZxeT5wi_6EPxFJgqtXuqraog@mail.gmail.com>
Date: Tue, 12 Aug 2014 11:37:15 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: David Howells <dhowells@...hat.com>
Cc: Al Viro <viro@...iv.linux.org.uk>, linux-unionfs@...r.kernel.org,
Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Race in ovl_copy_up()?
On Mon, Aug 11, 2014 at 4:37 PM, David Howells <dhowells@...hat.com> wrote:
> In the for-loop in the middle, if you ascend any levels at all, how are you
> protected from racing with copy-ups taking place on those more rootwards
> dentries?
>
> I can see ovl_copy_up_one() using lock_rename() on the workdir and upperdir,
> but there's no relevant lock on the overlayfs fs.
Locking upperdir should be enough protection.
Lets say we have a race:
A: copy_up(a/b/c/d)
B: copy_up(a/b/e/f)
Both ascend to "b" and try to lock "a". The one that wins the lock
acquisition will do the copy-up, the other one will just skip it once
it gets the lock.
Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists