remap_flags, op);
 }
 
+static int ovl_flush(struct file *file, fl_owner_t id)
+{
+       struct fd real;
+       const struct cred *old_cred;
+       int err;
+
+       err = ovl_real_fdget(file, &real);
+       if (err)
+               return err;
+
+       if (real.file->f_op->flush) {
+               old_cred = ovl_override_creds(file_inode(file)->i_sb);
+               err = real.file->f_op->flush(real.file, id);
+               revert_creds(old_cred);
+       }
+       fdput(real);
+
+       return err;
+}
+
 const struct file_operations ovl_file_operations = {
        .open           = ovl_open,
        .release        = ovl_release,
        .fallocate      = ovl_fallocate,
        .fadvise        = ovl_fadvise,
        .unlocked_ioctl = ovl_ioctl,
+       .flush          = ovl_flush,
 #ifdef CONFIG_COMPAT
        .compat_ioctl   = ovl_compat_ioctl,
 #endif