@Override
    public void close() throws IOException {
      super.close();

      BufferExposingByteArrayOutputStream attributeValueHolder = (BufferExposingByteArrayOutputStream)out;
      int attributeValueSize = attributeValueHolder.size();
      checkAttributeValueSize(attribute, attributeValueSize);

      PersistentFSRecordsStorage records = connection.getRecords();
      lock.writeLock().lock();
      try {
        int encodedAttributeId = connection.getAttributeId(attribute.getId());
        int attributesRecordId = records.getAttributeRecordId(fileId);

        int updatedAttributesRecordId = updateAttribute(
          attributesRecordId,
          fileId, encodedAttributeId,
          attributeValueHolder.getInternalBuffer(), attributeValueSize
        );

        //skip (updatedAttributesRecordId != attributesRecordId) check since we want to _always_ update file.modCount
        records.setAttributeRecordId(fileId, updatedAttributesRecordId);
      }
      catch (Throwable t) {
        LOG.warn("Error storing " + attribute + " of file(" + fileId + ")");
        //FIXME RC: don't use static method -- use specific VFS instance to handle the error
        //          Even better: setup error processing in FSRecordsImpl.writeAttribute() -- wrap returned stream,
        //          and add exception handling into the .close() method.
        throw FSRecords.handleError(t);
      }
      finally {
        lock.writeLock().unlock();
      }
    }
@Override
    public void close()