]> git.itanic.dy.fi Git - linux-stable/commit
ovl: fix regression caused by exclusive upper/work dir protection
authorAmir Goldstein <amir73il@gmail.com>
Fri, 29 Sep 2017 07:21:21 +0000 (10:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:16 +0000 (11:56 +0200)
commitea83a3f315c356ca8baf78a3b79cb2bb88b09939
tree18341b4182c668732ce8247d58f0595bc68484b3
parent1135139af4bff1f5a42a22cea1f28423184ca76d
ovl: fix regression caused by exclusive upper/work dir protection

commit 85fdee1eef1a9e48ad5716916677e0c5fbc781e3 upstream.

Enforcing exclusive ownership on upper/work dirs caused a docker
regression: https://github.com/moby/moby/issues/34672.

Euan spotted the regression and pointed to the offending commit.
Vivek has brought the regression to my attention and provided this
reproducer:

Terminal 1:

  mount -t overlay -o workdir=work,lowerdir=lower,upperdir=upper none
        merged/

Terminal 2:

  unshare -m

Terminal 1:

  umount merged
  mount -t overlay -o workdir=work,lowerdir=lower,upperdir=upper none
        merged/
  mount: /root/overlay-testing/merged: none already mounted or mount point
         busy

To fix the regression, I replaced the error with an alarming warning.
With index feature enabled, mount does fail, but logs a suggestion to
override exclusive dir protection by disabling index.
Note that index=off mount does take the inuse locks, so a concurrent
index=off will issue the warning and a concurrent index=on mount will fail.

Documentation was updated to reflect this change.

Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs")
Reported-by: Euan Kemp <euank@euank.com>
Reported-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/filesystems/overlayfs.txt
fs/overlayfs/ovl_entry.h
fs/overlayfs/super.c