lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090508160544.28189203.akpm@linux-foundation.org>
Date:	Fri, 8 May 2009 16:05:44 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
Cc:	benh@...nel.crashing.org, cbe-oss-dev@...abs.org,
	linux-kernel@...r.kernel.org,
	linux-fbdev-devel@...ts.sourceforge.net,
	Geert.Uytterhoeven@...ycom.com, jim@...n.com
Subject: Re: [PATCH 04/15] ps3vram: Replace mutex by spinlock + list

On Fri,  8 May 2009 16:01:13 +0200
Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com> wrote:

> +static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
> +{
> +	struct ps3_system_bus_device *dev = q->queuedata;
> +	struct ps3vram_priv *priv = dev->core.driver_data;
> +
> +	dev_dbg(&dev->core, "%s\n", __func__);
> +
> +	spin_lock_irq(&priv->lock);
> +	if (priv->tail) {
> +		priv->tail->bi_next = bio;
> +		priv->tail = bio;
> +		spin_unlock_irq(&priv->lock);
> +		return 0;
> +	}
> +
> +	priv->tail = bio;
> +	spin_unlock_irq(&priv->lock);
> +
> +	do {
> +		bio = ps3vram_do_bio(dev, bio);
> +	} while (bio);

Is there something which prevents two threads of control from walking
the same list at the same time?

> +
>  	return 0;
>  }

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ