[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1378365995.4058.18.camel@linux-fkkt.site>
Date: Thu, 05 Sep 2013 09:26:35 +0200
From: Oliver Neukum <oliver@...kum.org>
To: Gerd Hoffmann <kraxel@...hat.com>
Cc: linux-usb@...r.kernel.org, Matthew Wilcox <willy@...ux.intel.com>,
Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
Matthew Dharm <mdharm-usb@...-eyed-alien.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"open list:USB ATTACHED SCSI" <linux-scsi@...r.kernel.org>,
"open list:USB MASS STORAGE..."
<usb-storage@...ts.one-eyed-alien.net>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/5] uas: add dead request list
On Mon, 2013-09-02 at 13:25 +0200, Gerd Hoffmann wrote:
> +static void uas_zap_dead(struct uas_dev_info *devinfo)
> +{
> + struct uas_cmd_info *cmdinfo;
> + struct uas_cmd_info *temp;
> + struct list_head list;
> + unsigned long flags;
> +
> + spin_lock_irq(&uas_lists_lock);
> + list_replace_init(&uas_dead_list, &list);
> + spin_unlock_irq(&uas_lists_lock);
This looks like a window for a race.
> + spin_lock_irqsave(&devinfo->lock, flags);
> + list_for_each_entry_safe(cmdinfo, temp, &list, dead) {
> +
What happens if list entries are on the private list, when
the function is called for another device? It looks to me like
the di==devinfo test could put them back on the list although
they would need to be canceled.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists