• Amir Goldstein's avatar
    ovl: fix failure to fsync lower dir · d796e77f
    Amir Goldstein authored
    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: default avatarRaphael Hertzog <raphael@ouaza.com>
    Cc: <stable@vger.kernel.org> # v3.18
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Tested-by: default avatarRaphaël Hertzog <hertzog@debian.org>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    d796e77f
readdir.c 23.5 KB