Skip to content

Commit 49be68c

Browse files
palijankara
authored andcommitted
udf: Fix meaning of ENTITYID_FLAGS_* macros to be really bitwise-or flags
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>
1 parent a4a8b99 commit 49be68c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/udf/ecma_167.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ struct regid {
9595
} __packed;
9696

9797
/* Flags (ECMA 167r3 1/7.4.1) */
98-
#define ENTITYID_FLAGS_DIRTY 0x00
99-
#define ENTITYID_FLAGS_PROTECTED 0x01
98+
#define ENTITYID_FLAGS_DIRTY 0x01
99+
#define ENTITYID_FLAGS_PROTECTED 0x02
100100

101101
/* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
102102
#define VSD_STD_ID_LEN 5

‎fs/udf/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ static int udf_verify_domain_identifier(struct super_block *sb,
773773
udf_warn(sb, "Not OSTA UDF compliant %s descriptor.\n", dname);
774774
goto force_ro;
775775
}
776-
if (ident->flags & (1 << ENTITYID_FLAGS_DIRTY)) {
776+
if (ident->flags & ENTITYID_FLAGS_DIRTY) {
777777
udf_warn(sb, "Possibly not OSTA UDF compliant %s descriptor.\n",
778778
dname);
779779
goto force_ro;

0 commit comments

Comments
 (0)