From: Ed L. Cashin Date: Fri, 8 Feb 2008 12:20:06 +0000 (-0800) Subject: aoe: only install new AoE device once X-Git-Tag: v2.6.25-rc1~173 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6b9699bbd24e82d2ec3bb5a43100099a936ded04;p=linux-2.6-omap-h63xx.git aoe: only install new AoE device once An aoe driver user who had about 70 AoE targets found that he was hitting a BUG in sysfs_create_file because the aoe driver was trying to tell the kernel about an AoE device more than once. Each AoE device was reachable by several local network interfaces, and multiple ATA device indentify responses were returning from that single device. This patch eliminates a race condition so that aoe always informs the block layer of a new AoE device once in the presence of multiple incoming ATA device identify responses. Signed-off-by: Ed L. Cashin Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index b49e06ef121..7a9618313ea 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -698,6 +698,8 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) d->fw_ver, (long long)ssize); d->ssize = ssize; d->geo.start = 0; + if (d->flags & (DEVFL_GDALLOC|DEVFL_NEWSIZE)) + return; if (d->gd != NULL) { d->gd->capacity = ssize; d->flags |= DEVFL_NEWSIZE;