]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: mount read-only if workdir can't be created
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 19 May 2015 12:30:12 +0000 (14:30 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Tue, 19 May 2015 12:30:12 +0000 (14:30 +0200)
commit5f1af5454d9a9bc2367c371efed9b9fa79e93b54
tree0d3cb24661ad0c375540791ec24c6fc80760f5b3
parent0c5e2d34c281f63e6198ae1f1ffe852260de0088
ovl: mount read-only if workdir can't be created

OpenWRT folks reported that overlayfs fails to mount if upper fs is full,
because workdir can't be created.  Wordir creation can fail for various
other reasons too.

There's no reason that the mount itself should fail, overlayfs can work
fine without a workdir, as long as the overlay isn't modified.

So mount it read-only and don't allow remounting read-write.

Add a couple of WARN_ON()s for the impossible case of workdir being used
despite being read-only.

Reported-by: Bastian Bittorf <bittorf@bluebottle.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <stable@vger.kernel.org> # v3.18+
fs/overlayfs/copy_up.c
fs/overlayfs/dir.c
fs/overlayfs/super.c