[sheepdog] [PATCH] sheep: check EAGAIN for all the sd_lock helpers

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Dec 17 06:35:27 CET 2013


At Tue, 17 Dec 2013 13:08:24 +0800,
Liu Yuan wrote:
> 
> Some users report that:
> 
> [root at pangkvm01 sheepdog]# cat sheep.log.bak |grep "Dec 16 23"
> Dec 16 23:34:22  ERROR [main] modify_event(156) event info for fd 106 not
> found
> Dec 16 23:40:24  EMERG [io 5574] crash_handler(250) sheep exits unexpectedly
> (Segmentation fault).
> Dec 16 23:40:24  EMERG [io 7281] sd_write_lock(307) PANIC: failed to lock
> for writing, Resource temporarily unavailable
> Dec 16 23:40:24  EMERG [io 7281] crash_handler(250) sheep exits unexpectedly
> (Aborted).
> 
> It means some posix lock funcitions can return what is not documented in manual.
> So it's better for us to defensively check it rather than panic out.
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  include/util.h |   22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)

Looks good to me.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Thanks,
Hitoshi



More information about the sheepdog mailing list