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: <20160921121531.7786ee9b@bbrezillon>
Date:   Wed, 21 Sep 2016 12:15:31 +0200
From:   Boris Brezillon <boris.brezillon@...e-electrons.com>
To:     Daniel Walter <dwalter@...ma-star.at>, computersforpeace@...il.com
Cc:     linux-mtd@...ts.infradead.org, Richard Weinberger <richard@....at>,
        dwmw2@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/46] mtdpart: Propagate _get/put_device()

On Wed, 21 Sep 2016 11:43:56 +0200
Daniel Walter <dwalter@...ma-star.at> wrote:

> From: Richard Weinberger <richard@....at>
> 
> If the master device has callbacks for _get/put_device()
> and this MTD has slaves a get_mtd_device() call on paritions
> will never issue the registered callbacks.
> Fix this by propagating _get/put_device() down.

Brian, can we have this one queued for 4.9? I can't take it in my tree
if you want, but it's probably better if it's in the mtd tree.

> 
> Reviewed-by: Boris Brezillon <boris.brezillon@...e-electrons.com>
> Signed-off-by: Richard Weinberger <richard@....at>
> ---
>  drivers/mtd/mtdpart.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
> index 1f13e32..ec852fa 100644
> --- a/drivers/mtd/mtdpart.c
> +++ b/drivers/mtd/mtdpart.c
> @@ -317,6 +317,18 @@ static int part_block_markbad(struct mtd_info *mtd, loff_t ofs)
>  	return res;
>  }
>  
> +static int part_get_device(struct mtd_info *mtd)
> +{
> +	struct mtd_part *part = mtd_to_part(mtd);
> +	return part->master->_get_device(part->master);
> +}
> +
> +static void part_put_device(struct mtd_info *mtd)
> +{
> +	struct mtd_part *part = mtd_to_part(mtd);
> +	part->master->_put_device(part->master);
> +}
> +
>  static int part_ooblayout_ecc(struct mtd_info *mtd, int section,
>  			      struct mtd_oob_region *oobregion)
>  {
> @@ -463,6 +475,12 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
>  		slave->mtd._block_isbad = part_block_isbad;
>  	if (master->_block_markbad)
>  		slave->mtd._block_markbad = part_block_markbad;
> +
> +	if (master->_get_device)
> +		slave->mtd._get_device = part_get_device;
> +	if (master->_put_device)
> +		slave->mtd._put_device = part_put_device;
> +
>  	slave->mtd._erase = part_erase;
>  	slave->master = master;
>  	slave->offset = part->offset;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ