[sheepdog] [PATCH] sheep/plain_store: fix error path in default_create_and_write
Liu Yuan
namei.unix at gmail.com
Wed Oct 17 10:40:41 CEST 2012
On 10/16/2012 02:13 PM, MORITA Kazutaka wrote:
> Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> ---
> sheep/plain_store.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/sheep/plain_store.c b/sheep/plain_store.c
> index 995f7d4..6716061 100644
> --- a/sheep/plain_store.c
> +++ b/sheep/plain_store.c
> @@ -307,7 +307,7 @@ int default_create_and_write(uint64_t oid, struct siocb *iocb)
>
> fd = open(tmp_path, flags, def_fmode);
> if (fd < 0) {
> - if (errno == EEXIST)
> + if (errno == EEXIST) {
> /* This happens if node membership changes during object
> * creation; while gateway retries a CREATE request,
> * recovery process could also recover the object at the
> @@ -315,6 +315,7 @@ int default_create_and_write(uint64_t oid, struct siocb *iocb)
> * so it is okay to simply return success here. */
> dprintf("%s exists\n", tmp_path);
> return SD_RES_SUCCESS;
> + }
>
> eprintf("failed to open %s: %m\n", tmp_path);
> return err_to_sderr(oid, errno);
>
Applied, thanks.
Yuan
More information about the sheepdog
mailing list