From patchwork Tue Jul 11 12:12:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 786581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3x6LZg2XMNz9s7g; Tue, 11 Jul 2017 22:13:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b="qwBChAMu"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1dUu2S-0003v3-OC; Tue, 11 Jul 2017 12:13:12 +0000 Received: from mail-it0-f46.google.com ([209.85.214.46]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1dUu2I-0003tX-77 for kernel-team@lists.ubuntu.com; Tue, 11 Jul 2017 12:13:02 +0000 Received: by mail-it0-f46.google.com with SMTP id m84so17764922ita.0 for ; Tue, 11 Jul 2017 05:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=oC+WbPdDu7daUTAJNoevNqmBMN2GN8WJVYa3OvVuOM8=; b=qwBChAMuYBvyztZi1NLhUiOcFROGqDWQ5eoJrD2egmA3xtKyMLn97AzuOgKE7/lzTl gRhnGQ6j6vWXGNIp8Svf47ZmeixBi53vTFkDSQemvnW7FIODt4GpYLJyIRm9sFiG0NiG mxaXids35wKor2TeLABaO+GJ5pMOXmfyOiXzM/sMjB7GPzdOSHVD6uHl/Kn63CvHyOq/ 5cfEsmRSnXZjAcmUXNTA5w3xLOttwe2vaoTmvsNKeqcDjXSbgBPYdDtGMR7N97ufCua5 mSoJoNFtkE4EiUK6moLylHNm30fMGbmT1ax94VINC1R+BR7NE3Af2W1v4CZrKSvj5thK PYIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=oC+WbPdDu7daUTAJNoevNqmBMN2GN8WJVYa3OvVuOM8=; b=EypOA2PONcDmG8llEEcTfujwu2YrGPGnmd/pZKs0FH8Lho1q7Lx7++NwPWI0DhktWf 3ySABxpjsgssLKtg/7rmJvoe2HVxQK3XkEBejxnvaKqbgdbFgJYJNocK8v5wmBaXolI7 lI5rUO/A/4mJdiQDuGPS2y9LdAD8Hwvi2gAk/cNUOPsGua+HcZpjQCA5hZDItw5sN5Il z/XFEZIjtS1FQ1keFLdN3HzzMbL9g9mRFRXeq4vlsWYn3xzpr947XbrSsJORejosqfbi SfbP5EAUT/lRcvursvJ51ORlUguML1ZBBX23SGysdLBnuscaQOWwkuXrfsFXPog+AlyJ F5aA== X-Gm-Message-State: AIVw113HyTE6wcQCFHCoHCn0/Ht5t22Wc5wffHhYxo3GnF6y3gUVTYn7 vWnokcGU+FDjpzwiw6g= X-Received: by 10.36.189.198 with SMTP id x189mr2892251ite.56.1499775180828; Tue, 11 Jul 2017 05:13:00 -0700 (PDT) Received: from localhost ([2605:a601:aa7:8920:6532:ddaa:456c:f059]) by smtp.gmail.com with ESMTPSA id 66sm7477433ioj.47.2017.07.11.05.12.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 05:12:58 -0700 (PDT) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][Yakkety/Zesty] UBUNTU: SAUCE: hio: Fix incorrect use of enum req_opf values Date: Tue, 11 Jul 2017 07:12:56 -0500 Message-Id: <20170711121256.27631-2-seth.forshee@canonical.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170711121256.27631-1-seth.forshee@canonical.com> References: <20170711121256.27631-1-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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 Acked-by: Colin Ian King Acked-by: Stefan Bader --- 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