Commit 93d489fc authored by Ed L Cashin's avatar Ed L Cashin Committed by Greg KH

[PATCH] aoe: allow multiple aoe devices to have the same mac

allow multiple aoe devices to have the same mac
Signed-off-by: default avatarEd L. Cashin <ecashin@coraid.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>

diff -u b/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
parent 67d9f847
...@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu ...@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu
spin_lock_irqsave(&devlist_lock, flags); spin_lock_irqsave(&devlist_lock, flags);
for (d=devlist; d; d=d->next) for (d=devlist; d; d=d->next)
if (d->sysminor == sysminor if (d->sysminor == sysminor)
|| memcmp(d->addr, addr, sizeof d->addr) == 0)
break; break;
if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) {
spin_unlock_irqrestore(&devlist_lock, flags); spin_unlock_irqrestore(&devlist_lock, flags);
printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n");
return NULL; return NULL;
} } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */
spin_unlock_irqrestore(&devlist_lock, flags); spin_unlock_irqrestore(&devlist_lock, flags);
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
d->ifp = ifp; d->ifp = ifp;
if (d->sysminor != sysminor
|| (d->flags & DEVFL_UP) == 0) {
aoedev_downdev(d); /* flushes outstanding frames */
memcpy(d->addr, addr, sizeof d->addr); memcpy(d->addr, addr, sizeof d->addr);
if ((d->flags & DEVFL_UP) == 0) {
aoedev_downdev(d); /* flushes outstanding frames */
d->sysminor = sysminor; d->sysminor = sysminor;
d->aoemajor = AOEMAJOR(sysminor); d->aoemajor = AOEMAJOR(sysminor);
d->aoeminor = AOEMINOR(sysminor); d->aoeminor = AOEMINOR(sysminor);
......
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