Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753191AbbEGJue (ORCPT ); Thu, 7 May 2015 05:50:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48299 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbbEGJu0 (ORCPT ); Thu, 7 May 2015 05:50:26 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: "Theodore Ts'o" , Moritz Muehlenhoff , Luis Henriques Subject: [PATCH 3.16.y-ckt 177/180] ext4: fix accidental flag aliasing in ext4_map_blocks flags Date: Thu, 7 May 2015 10:46:26 +0100 Message-Id: <1430991989-23170-178-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430991989-23170-1-git-send-email-luis.henriques@canonical.com> References: <1430991989-23170-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1762 Lines: 50 3.16.7-ckt11 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit bd30d702fc320085f178d22866b32fdc4736c991 upstream. Commit b8a8684502a0f introduced an accidental flag aliasing between EXT4_EX_NOCACHE and EXT4_GET_BLOCKS_CONVERT_UNWRITTEN. Fortunately, this didn't introduce any untorward side effects --- we got lucky. Nevertheless, fix this and leave a warning to hopefully avoid this from happening in the future. Signed-off-by: Theodore Ts'o Cc: Moritz Muehlenhoff Signed-off-by: Luis Henriques --- fs/ext4/ext4.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 20889da7f8a0..e00dc9772402 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -569,6 +569,7 @@ enum { #define EXT4_GET_BLOCKS_NO_PUT_HOLE 0x0200 /* Convert written extents to unwritten */ #define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN 0x0400 +/* DO NOT ASSIGN ADDITIONAL FLAG VALUES WITHOUT ADJUSTING THE FLAGS BELOW */ /* * The bit position of these flags must not overlap with any of the @@ -579,8 +580,8 @@ enum { * caching the extents when reading from the extent tree while a * truncate or punch hole operation is in progress. */ -#define EXT4_EX_NOCACHE 0x0400 -#define EXT4_EX_FORCE_CACHE 0x0800 +#define EXT4_EX_NOCACHE 0x0800 +#define EXT4_EX_FORCE_CACHE 0x1000 /* * Flags used by ext4_free_blocks -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/