Commit 25f4d75e authored by Ed Cashin's avatar Ed Cashin Committed by Linus Torvalds

aoe: do revalidation steps in order

The discovery process begins with an optional AoE config query command and
an AoE config query response.  Normally when an aoe device is already
open, the config query response does not trigger an ATA identify device
command to be sent out, since the response contains storage capacity
information that, if changed, could surprise the user of the device.

The userland "aoe-revalidate" tool uses a character device to trigger an
AoE config query for a particular AoE storage target and an ATA device
identify command, even when the device is open.

This change causes the config query to go out first, reflecting the normal
discovery sequence.  The responses could come back in any order, so this
change is fairly cosmetic.
Signed-off-by: default avatarEd Cashin <ecashin@coraid.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d54d35ac
...@@ -96,13 +96,14 @@ revalidate(const char __user *str, size_t size) ...@@ -96,13 +96,14 @@ revalidate(const char __user *str, size_t size)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
aoecmd_cleanslate(d); aoecmd_cleanslate(d);
aoecmd_cfg(major, minor);
loop: loop:
skb = aoecmd_ata_id(d); skb = aoecmd_ata_id(d);
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
/* try again if we are able to sleep a bit, /* try again if we are able to sleep a bit,
* otherwise give up this revalidation * otherwise give up this revalidation
*/ */
if (!skb && !msleep_interruptible(200)) { if (!skb && !msleep_interruptible(250)) {
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
goto loop; goto loop;
} }
...@@ -113,7 +114,6 @@ revalidate(const char __user *str, size_t size) ...@@ -113,7 +114,6 @@ revalidate(const char __user *str, size_t size)
__skb_queue_tail(&queue, skb); __skb_queue_tail(&queue, skb);
aoenet_xmit(&queue); aoenet_xmit(&queue);
} }
aoecmd_cfg(major, minor);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment