From: Malahal Naineni <malahal@us.ibm.com>
To: dm-devel@redhat.com
Subject: Re: [PATCH] multipath: fix multipath locking
Date: Thu, 4 Nov 2010 22:59:52 -0700 [thread overview]
Message-ID: <20101105055952.GA9165@us.ibm.com> (raw)
In-Reply-To: <20101105045946.GJ13763@ether.msp.redhat.com>
Benjamin Marzinski [bmarzins@redhat.com] wrote:
> @@ -294,12 +295,25 @@ lock_multipath (struct multipath * mpp,
> vector_foreach_slot(pgp->paths, pp, j) {
> if (lock && flock(pp->fd, LOCK_EX | LOCK_NB) &&
> errno == EWOULDBLOCK)
> - return 1;
> + goto fail;
> else if (!lock)
> flock(pp->fd, LOCK_UN);
> }
> }
> return 0;
> +fail:
> + vector_foreach_slot (mpp->pg, pgp, x) {
> + if (x > i)
> + return 1;
> + if (!pgp->paths)
> + continue;
> + vector_foreach_slot(pgp->paths, pp, y) {
> + if (x == i && y > j)
Path 'j' has failed to get the lock dropping us to the fail label.
We should NOT be unlocking for path "j", so the above if expression
should be "(x ==i && y >= j)" instead.
Otherwise, it looks good.
> + return 1;
> + flock(pp->fd, LOCK_UN);
> + }
> + }
> + return 1;
next prev parent reply other threads:[~2010-11-05 5:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 4:59 [PATCH] multipath: fix multipath locking Benjamin Marzinski
2010-11-05 5:59 ` Malahal Naineni [this message]
2010-11-05 7:11 ` Christophe Varoqui
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=20101105055952.GA9165@us.ibm.com \
--to=malahal@us.ibm.com \
--cc=dm-devel@redhat.com \
/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.