[sheepdog] [sheepdog/sheepdog] 564797: sheep: avoid panic in COW when sheep fails to allo...

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Sat Aug 15 08:26:18 CEST 2015

  Branch: refs/heads/enomem
  Home:   https://github.com/sheepdog/sheepdog
  Commit: 5647976158ff459cc97a688dd42d7a7cd87a2a39
  Author: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
  Date:   2015-08-15 (Sat, 15 Aug 2015)

  Changed paths:
    M sheep/gateway.c

  Log Message:
  sheep: avoid panic in COW when sheep fails to allocate memory

Current code for COW requests can call panic() because it uses
xzalloc() and xcalloc() for processing the requests. This commit lets
the code avoid use the functions and return SD_RES_NO_MEM because COW
is a very common and frequent request. It is better to return error
code to VMs than killing sheep.

Even if the memory allocations fail, it just causes object leaks. This
behavior is not changed from the existing strategy which calls

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

More information about the sheepdog mailing list