vfs: intercept fsync on overlay files

Fsync is really an inode operation (AFAICS) so a doing it on a O_RDONLY
file descriptor should flush any data written through an O_WRONLY file
descriptor for example.

To make this work correctly in case the file is copied up after being
opened for read, intercept the fsync operation, similarly to read_iter and
mmap.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
3 files changed