From 49be68c4931d9f0f171e5f01a574fc40205db2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 12 Jan 2020 23:13:53 +0100 Subject: [PATCH] udf: Fix meaning of ENTITYID_FLAGS_* macros to be really bitwise-or flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently ENTITYID_FLAGS_* macros definitions are written as hex numbers but their meaning is not bitwise-or flags. But rather bit position. This is unusual and could be misleading. So change meaning of ENTITYID_FLAGS_* macros definitions to be really bitwise-or flags. Link: https://lore.kernel.org/r/20200112221353.29711-1-pali.rohar@gmail.com Signed-off-by: Pali Rohár Signed-off-by: Jan Kara --- fs/udf/ecma_167.h | 4 ++-- fs/udf/super.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/udf/ecma_167.h b/fs/udf/ecma_167.h index f9ee412fedc4..3fd85464abd5 100644 --- a/fs/udf/ecma_167.h +++ b/fs/udf/ecma_167.h @@ -95,8 +95,8 @@ struct regid { } __packed; /* Flags (ECMA 167r3 1/7.4.1) */ -#define ENTITYID_FLAGS_DIRTY 0x00 -#define ENTITYID_FLAGS_PROTECTED 0x01 +#define ENTITYID_FLAGS_DIRTY 0x01 +#define ENTITYID_FLAGS_PROTECTED 0x02 /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */ #define VSD_STD_ID_LEN 5 diff --git a/fs/udf/super.c b/fs/udf/super.c index 5a4a6fb36819..0311c7decdd2 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -773,7 +773,7 @@ static int udf_verify_domain_identifier(struct super_block *sb, udf_warn(sb, "Not OSTA UDF compliant %s descriptor.\n", dname); goto force_ro; } - if (ident->flags & (1 << ENTITYID_FLAGS_DIRTY)) { + if (ident->flags & ENTITYID_FLAGS_DIRTY) { udf_warn(sb, "Possibly not OSTA UDF compliant %s descriptor.\n", dname); goto force_ro;