From: Philipp Reisner <philipp.reisner@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] FW: [DRBD-cvs] svn commit by phil - r2534 - trunk/drbd - Added missinginitialisations of rs_failed.
Date: Mon, 16 Oct 2006 15:59:15 +0200 [thread overview]
Message-ID: <200610161559.15412.philipp.reisner@linbit.com> (raw)
In-Reply-To: <342BAC0A5467384983B586A6B0B3767103C3BAA6@EXNA.corp.stratus.com>
Am Montag, 16. Oktober 2006 15:16 schrieb Graham, Simon:
> Thanks for finding/fixing my bugs! I do have one question on this change
> though:
>
> lc_put(mdev->resync,&ext->lce);
> // no race, we are within the al_lock!
>
> - if (ext->rs_left <= ext->rs_failed) {
> - ext->rs_left = ext->rs_failed = 0;
> + if (ext->rs_left == ext->rs_failed) {
> + ext->rs_failed = 0;
>
> With this change, when rs_left==rs_failed, you do not clear rs_left but
> only rs_failed -- I cleared both so that next time we used the extent we'd
> start from scratch again - was my understanding incorrect?
Yes, I just changed it from "cleanup after use" to "initialize before use" ;)
The "cleanup after use" semantics is for all cases correct, but not for
the first use.
>
> Simon
>
> PS: FWIW, I chose to use <= rather than == deliberately as I felt this is
> more tolerant of problems elsewhere in the code -- yes in theory rs_left
> should never be less than rs_failed but <= works as well and actually
> better if there is a bug elsewhere that decrements rs_left when it
> shouldn't...
I can really follow that, and would have done it the same probably. But
with the bug that hit me today, that "<=" caused more trouble than a
"==" does ;)
The "<" case is explicitly caught with the ERR("BAD!...) statement...
-Philipp
--
: Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria http://www.linbit.com :
prev parent reply other threads:[~2006-10-16 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-16 13:16 [Drbd-dev] FW: [DRBD-cvs] svn commit by phil - r2534 - trunk/drbd - Added missinginitialisations of rs_failed Graham, Simon
2006-10-16 13:59 ` Philipp Reisner [this message]
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=200610161559.15412.philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=drbd-dev@lists.linbit.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox