]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:07:00 +0000 (20:07 +0100)
commite14a5067b13c8d28b138ded9d89c4fd3a79637bd
treebf4f88f51cfe91adaf47f5a010c586d242448f29
parent74ef3034525acd9330be48b57df74c67f92ede3a
ovl: force r/o mount when index dir creation fails

commit 972d0093c2f7b1bd57e47a1780a552dde528fd16 upstream.

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")
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>
fs/overlayfs/super.c