'Verify the metadata\'s name value matches what we think the object is
named.
:param data_file: data file name being consider, used when quarantines
occur
:param fp: open file pointer so that we can `fstat()` the file to
verify the on-disk size with Content-Length metadata value
:raises DiskFileCollision: if the metadata stored name does not match
the referenced name of the file
:raises DiskFileExpired: if the object has expired
:raises DiskFileQuarantined: if data inconsistencies were detected
between the metadata and the file-system
metadata'

def _verify_data_file(self, data_file, fp):

    try:
        mname = self._metadata['name']
    except KeyError:
        raise self._quarantine(data_file, 'missing    name    metadata')
    else:
        if (mname != self._name):
            self._logger.error(_('Client    path    %(client)s    does    not    match    path    stored    in    object    metadata    %(meta)s'), {'client': self._name, 'meta': mname})
            raise DiskFileCollision('Client    path    does    not    match    path    stored    in    object    metadata')
    try:
        x_delete_at = int(self._metadata['X-Delete-At'])
    except KeyError:
        pass
    except ValueError:
        raise self._quarantine(data_file, ('bad    metadata    x-delete-at    value    %s' % self._metadata['X-Delete-At']))
    else:
        if ((x_delete_at <= time.time()) and (not self._open_expired)):
            raise DiskFileExpired(metadata=self._metadata)
    try:
        metadata_size = int(self._metadata['Content-Length'])
    except KeyError:
        raise self._quarantine(data_file, 'missing    content-length    in    metadata')
    except ValueError:
        raise self._quarantine(data_file, ('bad    metadata    content-length    value    %s' % self._metadata['Content-Length']))
    fd = fp.fileno()
    try:
        statbuf = os.fstat(fd)
    except OSError as err:
        raise self._quarantine(data_file, ('not    stat-able:    %s' % err))
    else:
        obj_size = statbuf.st_size
    if (obj_size != metadata_size):
        raise self._quarantine(data_file, ('metadata    content-length    %s    does    not    match    actual    object    size    %s' % (metadata_size, statbuf.st_size)))
    self._content_length = obj_size
    return obj_size
