Re: [PATCH 2/2] rbd: add an option for md5 checksumming (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 25, 2011 at 04:03, Christian Brunner <chb@xxxxxx> wrote:
> +  if (buf) {
> +    dif = ofs-lastofs;
> +    if (dif > 0) {
> +      byte *tempbuf = (byte *) malloc(dif);
> +      memset(tempbuf, 0, dif);
> +      Hash->Update((const byte *) tempbuf, dif);
> +      free(tempbuf);
> +    }
> +
> +    Hash->Update((const byte *) buf, len);
> +    lastofs = ofs + len;
> +  }

Does this mean a file with a 100GB hole in it will make you malloc(100GB)?

> +  case OPT_MD5:
> +  case OPT_SHA1:
> +    r = do_hash(image, imgname, opt_cmd);
> +    if (r < 0) {
> +      cerr << "md5 hashing failed: " << strerror(-r) << std::endl;
> +      exit(1);

It's not always md5 hashing, yet the error message says md5..
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux