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] [day] [month] [year] [list]
Date:   Wed, 1 Feb 2017 20:35:20 +0000
From:   Bart Van Assche <Bart.VanAssche@...disk.com>
To:     "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "hch@....de" <hch@....de>, "axboe@...nel.dk" <axboe@...nel.dk>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "osandov@...ndov.com" <osandov@...ndov.com>,
        "James.Bottomley@...senpartnership.com" 
        <James.Bottomley@...senpartnership.com>,
        "jack@...e.cz" <jack@...e.cz>
Subject: Re: [PATCH v2] scsi, block: fix duplicate bdi name registration
 crashes

On Wed, 2017-02-01 at 11:32 -0800, Dan Williams wrote:
> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index 76f39754e7b0..27e7e12c0c2d 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -167,6 +167,22 @@ struct blk_integrity {
>  };
>  
>  #endif	/* CONFIG_BLK_DEV_INTEGRITY */
> +struct disk_devt {
> +	atomic_t count;
> +	void (*release)(struct disk_devt *disk_devt);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt && atomic_dec_and_test(&disk_devt->count))
> +		disk_devt->release(disk_devt);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> +	if (disk_devt)
> +		atomic_inc(&disk_devt->count);
> +}

The <linux/genhd.h> header file is included directly or indirectly in a
huge number of source files. Since neither get_disk_devt() nor
put_disk_devt() are called from the I/O path, please move these functions
fromĀ <linux/genhd.h> into block/genhd.c to keep the compilation time of
the kernel as short as possible.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ