]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - fs/overlayfs/super.c
ovl: force r/o mount when index dir creation fails
authorAmir Goldstein <amir73il@gmail.com>
Tue, 19 Sep 2017 09:14:18 +0000 (12:14 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 24 Jan 2018 09:19:14 +0000 (10:19 +0100)
commit972d0093c2f7b1bd57e47a1780a552dde528fd16
tree1c03a225241f389617884f9b452951a6a37ea40e
parenta683737ba924cd2985f6e7350520f449915ff8f9
ovl: force r/o mount when index dir creation fails

When work dir creation fails, a warning is emitted and overlay is
mounted r/o. Trying to remount r/w will fail with no work dir.

When index dir creation fails, the same warning is emitted and overlay
is mounted r/o, but trying to remount r/w will succeed. This may cause
unintentional corruption of filesystem consistency.

Adjust the behavior of index dir creation failure to that of work dir
creation failure and do not allow to remount r/w. User needs to state
an explicitly intention to work without an index by mounting with
option 'index=off' to allow r/w mount with no index dir.

When mounting with option 'index=on' and no 'upperdir', index is
implicitly disabled, so do not warn about no file handle support.

The issue was introduced with inodes index feature in v4.13, but this
patch will not apply cleanly before ovl_fill_super() re-factoring in
v4.15.

Fixes: 02bcd1577400 ("ovl: introduce the inodes index dir feature")
Cc: <stable@vger.kernel.org> #v4.13
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c