Re: [RFC PATCH] cryptsetup: replace udevsettle calls with temporary device error remapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the patch. Your suggestion is imho the right approach to
this problem.

At Thu, 04 Sep 2008 15:24:05 +0200,
Milan Broz <mbroz@xxxxxxxxxx> wrote:

> - It uses dm_task_update_nodes() instead of dm library reinitialization
> workaround.

I remember that this symbol isn't exported in all versions of
libdevmapper, that's why it's still the reinitialization trick. (Last
time I checked reinitialization didn't cause much harm).

> Index: cryptsetup.my/luks/keyencryption.c
> ===================================================================
> --- cryptsetup.my.orig/luks/keyencryption.c	2008-09-04 14:17:33.000000000 +0200
> +++ cryptsetup.my/luks/keyencryption.c	2008-09-04 14:17:36.000000000 +0200
> @@ -50,10 +50,8 @@ static int setup_mapping(const char *cip
>  			 const char *key, size_t keyLength, 
>  			 unsigned int sector, size_t srcLength, 
>  			 struct setup_backend *backend,
> -			 int mode)
> +			 int mode, struct crypt_options *options)
>  {
> -	struct crypt_options k;
> -	struct crypt_options *options = &k;
>  	int device_sector_size = sector_size_for_device(device);
>  	int r;
>  
> @@ -87,16 +85,14 @@ static int setup_mapping(const char *cip
>  	return r;
>  }
>  
> -static int clear_mapping(const char *name, struct setup_backend *backend)
> +static int clear_mapping(struct crypt_options *options, struct setup_backend *backend)
>  {
> -	struct crypt_options options;
> -	options.name=name;
> -	return backend->remove(&options);
> +	return backend->remove(1, options);
>  }
>  

I'm trying to get rid of the all-in-one, nobody-actually-knows-what-parts-are-used 
crypt_option structure. 

Is there a reason for you to reintroduce it?

> -	r = setup_mapping(dmCipherSpec,name,device,hdr->payloadOffset,key,keyLength,sector,srcLength,backend,mode);
> +	r = setup_mapping(dmCipherSpec,name,device,hdr->payloadOffset,key,keyLength,sector,srcLength,backend,mode,&options);
..
-- 
Fruhwirth Clemens - http://clemens.endorphin.org 

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux