]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
aoe: manipulate aoedev network stats under lock
authorEd Cashin <ecashin@coraid.com>
Fri, 9 Nov 2012 03:05:16 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 04:17:36 +0000 (15:17 +1100)
Signed-off-by: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoecmd.c

index 6ea27fd8954df833b781c1fe639a3683b7e38c74..9aefbe3957ca6d8e9ed899c3918aa6db044de234 100644 (file)
@@ -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;