From: Liu Yuan <namei.unix@gmail.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH Update] sheepdog: don't update inode when create_and_write fails
Date: Mon, 17 Dec 2012 13:22:31 +0800 [thread overview]
Message-ID: <50CEAC17.8040905@gmail.com> (raw)
In-Reply-To: <87obhtjqd3.wl%morita.kazutaka@lab.ntt.co.jp>
On 12/17/2012 11:43 AM, MORITA Kazutaka wrote:
> send_pending_req() needs to be called even in error case. Rather than
> moving the error check, I think it looks better to update
> s->inode.data_vdi_id only when rsp.result is SD_RES_SUCCESS.
Why can't we check the rsp.result in the first place? double check
rsp.result inside one function looks a little bit complicated to me.
How about
+ if (rsp.result != SD_RES_SUCCESS) {
+ acb->ret = -EIO;
+ error_report("%s", sd_strerror(rsp.result));
+ send_pending_req(s, aio_req->oid);
+ goto err;
+
+ }
By the way, seems that
send_pending_req(s, vid_to_data_oid(s->inode.vdi_id, idx));
can be reduced to
send_pending_req(s, aio_req->oid);
If yes, I can send another patch to fix.
Thanks,
Yuan
next prev parent reply other threads:[~2012-12-17 5:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 9:52 [Qemu-devel] [PATCH] sheepdog: don't update inode when create_and_write fails Liu Yuan
2012-12-15 9:58 ` Liu Yuan
2012-12-15 9:59 ` [Qemu-devel] [PATCH Update] " Liu Yuan
2012-12-17 3:43 ` MORITA Kazutaka
2012-12-17 5:22 ` Liu Yuan [this message]
2012-12-17 5:57 ` MORITA Kazutaka
2012-12-17 6:17 ` [Qemu-devel] [PATCH v2 1/2] " Liu Yuan
2012-12-17 6:17 ` [Qemu-devel] [PATCH v2 2/2] sheepdog: pass oid directly to send_pending_req() Liu Yuan
2012-12-17 7:49 ` MORITA Kazutaka
2012-12-17 7:49 ` [Qemu-devel] [PATCH v2 1/2] sheepdog: don't update inode when create_and_write fails MORITA Kazutaka
2012-12-19 14:25 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CEAC17.8040905@gmail.com \
--to=namei.unix@gmail.com \
--cc=kwolf@redhat.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.