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]
Date:	Fri, 1 Aug 2008 11:18:45 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jens Axboe <jens.axboe@...cle.com>
cc:	Neil Brown <neilb@...e.de>, Arthur Jones <ajones@...erbed.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-raid@...r.kernel.org, "Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [PULL REQUEST] md bug fixes and minor improvements



On Fri, 1 Aug 2008, Jens Axboe wrote:
> +			spin_lock_irq(&bitmap->mddev->queue->queue_lock);
>  			blk_plug_device(bitmap->mddev->queue);
> +			spin_unlock_irq(&bitmap->mddev->queue->queue_lock);

Can we please not have a chain of three dereferences in a row like that? 
That's an almost certain sign that we should either have a helper function 
or just a variable, and do it as

	queue = bitmap->mddev->queue;

	spin_lock_irq(&queue->queue_lock);
	blk_plug_device(queue);
	spin_unlock_irq(&queue->queue_lock);

Hmm? Perhaps the helper function is cleaner, ie

	static inline blk_plug_device_unlocked(struct request_queue * queue)
	{..

instead. That, of course, would have to use spin_lock_irqsave().

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