]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
udf: Fix meaning of ENTITYID_FLAGS_* macros to be really bitwise-or flags
authorPali Rohár <pali.rohar@gmail.com>
Sun, 12 Jan 2020 22:13:53 +0000 (23:13 +0100)
committerJan Kara <jack@suse.cz>
Mon, 13 Jan 2020 11:38:46 +0000 (12:38 +0100)
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 <pali.rohar@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/ecma_167.h
fs/udf/super.c

index f9ee412fedc45b765bf7bbf7cc670c2f191c8ed5..3fd85464abd5f6faae694ee1b3578e1aa772685f 100644 (file)
@@ -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
index 5a4a6fb368194faa5a376d9d5ef7466521355590..0311c7decdd209ed580896cc1276947af14c434d 100644 (file)
@@ -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;