ACK: [PATCH 1/1][Yakkety/Zesty] UBUNTU: SAUCE: hio: Fix incorrect use of enum req_opf values

Stefan Bader stefan.bader at canonical.com
Wed Jul 12 08:38:40 UTC 2017


On 11.07.2017 14:12, Seth Forshee wrote:
> BugLink: http://bugs.launchpad.net/bugs/1701316
> 
> Patch from Huawei to fix incorrect use of enumerated values for
> bio operations as bitmasks. A reordering of the enum in 4.10
> caused a change in behavior which has been leading to data
> corruption.
> 
> Signed-off-by: Seth Forshee <seth.forshee at canonical.com>

Acked-by: Stefan Bader <stefan.bader at canonical.com>

> ---
>  ubuntu/hio/hio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ubuntu/hio/hio.c b/ubuntu/hio/hio.c
> index 4320262a76ba..7f40497e5ea7 100644
> --- a/ubuntu/hio/hio.c
> +++ b/ubuntu/hio/hio.c
> @@ -2098,7 +2098,7 @@ static inline int ssd_bio_has_discard(struct bio *bio)
>  #ifndef SSD_TRIM
>  	return 0;
>  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
> -	return bio_op(bio) & REQ_OP_DISCARD;
> +	return bio_op(bio) == REQ_OP_DISCARD;
>  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
>  	return bio->bi_rw & REQ_DISCARD;
>  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
> @@ -2111,7 +2111,7 @@ static inline int ssd_bio_has_discard(struct bio *bio)
>  static inline int ssd_bio_has_flush(struct bio *bio)
>  {
>  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
> -	return bio_op(bio) & REQ_OP_FLUSH;
> +	return bio_op(bio) == REQ_OP_FLUSH;
>  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
>  	return bio->bi_rw & REQ_FLUSH;
>  #else
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20170712/92c56631/attachment.sig>


More information about the kernel-team mailing list