From: Ed Cashin <ecashin@coraid.com>
From: Ed Cashin <ecashin@coraid.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, ecashin@coraid.com
Subject: [PATCH 5/8] aoe: manipulate aoedev network stats under lock
Date: Thu, 8 Nov 2012 19:25:17 -0500 [thread overview]
Message-ID: <e8a1a14896156327aea0feff6a1076f7f121b748.1352410985.git.ecashin@coraid.com> (raw)
In-Reply-To: <cover.1352410985.git.ecashin@coraid.com>
With this bugfix in place the calculation of the criterion for
"lateness" is performed under lock. Without the lock, there is a
chance that one of the non-atomic operations performed on the
round trip time statistics could be incomplete, such that an
incorrect lateness criterion would be calculated.
Without this change, the effect of the bug would be rare
unecessary but benign retransmissions.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
drivers/block/aoe/aoecmd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 6ea27fd..9aefbe3 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -603,14 +603,14 @@ rexmit_timer(ulong vp)
d = (struct aoedev *) vp;
+ spin_lock_irqsave(&d->lock, flags);
+
/* timeout based on observed timings and variations */
timeout = 2 * d->rttavg >> RTTSCALE;
timeout += 8 * d->rttdev >> RTTDSCALE;
if (timeout == 0)
timeout = 1;
- spin_lock_irqsave(&d->lock, flags);
-
if (d->flags & DEVFL_TKILL) {
spin_unlock_irqrestore(&d->lock, flags);
return;
--
1.7.1
next prev parent reply other threads:[~2012-11-09 0:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 0:14 [PATCH 0/8] aoe: improved network congestion handling from v60 to v64+ Ed Cashin, Ed Cashin
2012-11-09 0:17 ` [PATCH 1/8] aoe: avoid running request handler on plugged queue Ed Cashin, Ed Cashin
2012-11-09 7:31 ` Jens Axboe
2012-11-09 0:19 ` [PATCH 2/8] aoe: provide ATA identify device content to user on request Ed Cashin, Ed Cashin
2012-11-09 0:21 ` [PATCH 3/8] aoe: improve network congestion handling Ed Cashin, Ed Cashin
2012-11-09 0:23 ` [PATCH 4/8] aoe: err device: include MAC addresses for unexpected responses Ed Cashin, Ed Cashin
2012-11-09 0:25 ` Ed Cashin, Ed Cashin [this message]
2012-11-09 0:27 ` [PATCH 6/8] aoe: use high-resolution RTTs with fallback to low-res Ed Cashin, Ed Cashin
2012-11-09 0:29 ` [PATCH 7/8] aoe: commands in retransmit queue use new destination on failure Ed Cashin, Ed Cashin
2012-11-09 0:31 ` [PATCH 8/8] aoe: update driver-internal version to 64+ Ed Cashin, Ed Cashin
-- strict thread matches above, loose matches on Subject: below --
2012-11-08 16:29 [PATCH 1/8] aoe: avoid running request handler on plugged queue Ed Cashin, Ed Cashin
2012-11-08 16:44 ` [PATCH 5/8] aoe: manipulate aoedev network stats under lock Ed Cashin, Ed Cashin
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=e8a1a14896156327aea0feff6a1076f7f121b748.1352410985.git.ecashin@coraid.com \
--to=ecashin@coraid.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®