]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ovl: fix failure to fsync lower dir
authorAmir Goldstein <amir73il@gmail.com>
Wed, 8 Nov 2017 07:39:46 +0000 (09:39 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:22 +0000 (10:28 -0500)
commitf8c71a2ae14d30df74595194f4daaf6987b721bd
tree311ef9cd6979223ee7e21f387688b23588e9e081
parent4e5d88a911f6c610afe11b36c9b3b36f8928daf7
ovl: fix failure to fsync lower dir

[ Upstream commit d796e77f1dd541fe34481af2eee6454688d13982 ]

As a writable mount, it is not expected for overlayfs to return
EINVAL/EROFS for fsync, even if dir/file is not changed.

This commit fixes the case of fsync of directory, which is easier to
address, because overlayfs already implements fsync file operation for
directories.

The problem reported by Raphael is that new PostgreSQL 10.0 with a
database in overlayfs where lower layer in squashfs fails to start.
The failure is due to fsync error, when PostgreSQL does fsync on all
existing db directories on startup and a specific directory exists
lower layer with no changes.

Reported-by: Raphael Hertzog <raphael@ouaza.com>
Cc: <stable@vger.kernel.org> # v3.18
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Tested-by: Raphaƫl Hertzog <hertzog@debian.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
fs/overlayfs/readdir.c