[PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-05-10 Thread Dmitry Monakhov
Reviewed-by: Christoph Hellwig 
Reviewed-by: Hannes Reinecke 
Reviewed-by: Martin K. Petersen 
Signed-off-by: Dmitry Monakhov 
---
 block/bio.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index 888e780..2f01f1b 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1889,6 +1889,10 @@ void bio_trim(struct bio *bio, int offset, int size)
bio_advance(bio, offset << 9);
 
bio->bi_iter.bi_size = size;
+
+   if (bio_integrity(bio))
+   bio_integrity_trim(bio, 0, size);
+
 }
 EXPORT_SYMBOL_GPL(bio_trim);
 
-- 
2.9.3



Re: [PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-19 Thread Martin K. Petersen
Dmitry Monakhov  writes:

Reviewed-by: Martin K. Petersen 

-- 
Martin K. Petersen  Oracle Linux Engineering


Re: [PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-05 Thread Hannes Reinecke
On 04/04/2017 08:56 PM, Dmitry Monakhov wrote:
> Reviewed-by: Christoph Hellwig 
> Signed-off-by: Dmitry Monakhov 
> ---
>  block/bio.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/bio.c b/block/bio.c
> index e75878f..fa84323 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1907,6 +1907,10 @@ void bio_trim(struct bio *bio, int offset, int size)
>   bio_advance(bio, offset << 9);
>  
>   bio->bi_iter.bi_size = size;
> +
> + if (bio_integrity(bio))
> + bio_integrity_trim(bio, 0, size);
> +
>  }
>  EXPORT_SYMBOL_GPL(bio_trim);
>  
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


[PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-04 Thread Dmitry Monakhov
Reviewed-by: Christoph Hellwig 
Signed-off-by: Dmitry Monakhov 
---
 block/bio.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index e75878f..fa84323 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1907,6 +1907,10 @@ void bio_trim(struct bio *bio, int offset, int size)
bio_advance(bio, offset << 9);
 
bio->bi_iter.bi_size = size;
+
+   if (bio_integrity(bio))
+   bio_integrity_trim(bio, 0, size);
+
 }
 EXPORT_SYMBOL_GPL(bio_trim);
 
-- 
2.9.3