aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-12-17 19:03:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:24 -0500
commit0d555ecfa468f6dc29697829844f2f79909e376f (patch)
tree53e9ad45f578f0eed1a64309e825afc8d576ae29
parent2292a7e109d28ffd70ad060b241f9bd2a687dfa0 (diff)
aoe: manipulate aoedev network stats under lock
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/block/aoe/aoecmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 6ea27fd8954d..9aefbe3957ca 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -603,14 +603,14 @@ rexmit_timer(ulong vp)
603 603
604 d = (struct aoedev *) vp; 604 d = (struct aoedev *) vp;
605 605
606 spin_lock_irqsave(&d->lock, flags);
607
606 /* timeout based on observed timings and variations */ 608 /* timeout based on observed timings and variations */
607 timeout = 2 * d->rttavg >> RTTSCALE; 609 timeout = 2 * d->rttavg >> RTTSCALE;
608 timeout += 8 * d->rttdev >> RTTDSCALE; 610 timeout += 8 * d->rttdev >> RTTDSCALE;
609 if (timeout == 0) 611 if (timeout == 0)
610 timeout = 1; 612 timeout = 1;
611 613
612 spin_lock_irqsave(&d->lock, flags);
613
614 if (d->flags & DEVFL_TKILL) { 614 if (d->flags & DEVFL_TKILL) {
615 spin_unlock_irqrestore(&d->lock, flags); 615 spin_unlock_irqrestore(&d->lock, flags);
616 return; 616 return;