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: <20130822201900.GB22556@redhat.com>
Date:	Thu, 22 Aug 2013 16:19:00 -0400
From:	Mike Snitzer <snitzer@...hat.com>
To:	Joe Jin <joe.jin@...cle.com>
Cc:	Mikulas Patocka <mpatocka@...hat.com>,
	device-mapper development <dm-devel@...hat.com>,
	Alasdair Kergon <agk@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] dm ioctl: allow change device target type to error

On Wed, Aug 21 2013 at 10:50pm -0400,
Joe Jin <joe.jin@...cle.com> wrote:

> Mikulas, thanks for you suggestions, I create new patch, can you please help
> review?
> 
> Subject: dm: add map_rq define for error
> 
> commit a5664da "dm ioctl: make bio or request based device type immutable"
> prevented "dmsetup wape_table" change the target type to "error" for there
> is not map_rq for error target type.
> 
> Signed-off-by: Joe Jin <joe.jin@...cle.com>
> ---
>  drivers/md/dm-target.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c
> index 37ba5db..b690910 100644
> --- a/drivers/md/dm-target.c
> +++ b/drivers/md/dm-target.c
> @@ -131,12 +131,19 @@ static int io_err_map(struct dm_target *tt, struct bio *bio)
>  	return -EIO;
>  }
>  
> +static int io_err_map_rq(struct dm_target *ti, struct request *clone,
> +			 union map_info *map_context)
> +{
> +	return -EIO;
> +}
> +
>  static struct target_type error_target = {
>  	.name = "error",
>  	.version = {1, 1, 0},
>  	.ctr  = io_err_ctr,
>  	.dtr  = io_err_dtr,
>  	.map  = io_err_map,
> +	.map_rq = io_err_map_rq,
>  };
>  
>  int __init dm_target_init(void)
> -- 
> 1.8.3.1

Hi Joe,

Unfortunately this isn't going to work properly.  Mikulas suggested a
new "error-rq" target.

I do like the idea of a single error target that is hybrid (supports
both bio-based and request-based) but the DM core would need to be
updated to support this.

Specifically, we'd need to check if the device (and active table) is
already bio-based or request-based and select the appropriate type.  If
it is a new device, default to selecting bio-based.

There are some wrappers and other logic thoughout DM core that will need
auditing too.

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