Skip to content

Commit bd30d70

Browse files
committed
ext4: fix accidental flag aliasing in ext4_map_blocks flags
Commit b8a8684 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 <tytso@mit.edu>
1 parent 713e8dd commit bd30d70

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎fs/ext4/ext4.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ enum {
569569
#define EXT4_GET_BLOCKS_NO_PUT_HOLE 0x0200
570570
/* Convert written extents to unwritten */
571571
#define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN 0x0400
572+
/* DO NOT ASSIGN ADDITIONAL FLAG VALUES WITHOUT ADJUSTING THE FLAGS BELOW */
572573

573574
/*
574575
* The bit position of these flags must not overlap with any of the
@@ -579,8 +580,8 @@ enum {
579580
* caching the extents when reading from the extent tree while a
580581
* truncate or punch hole operation is in progress.
581582
*/
582-
#define EXT4_EX_NOCACHE 0x0400
583-
#define EXT4_EX_FORCE_CACHE 0x0800
583+
#define EXT4_EX_NOCACHE 0x0800
584+
#define EXT4_EX_FORCE_CACHE 0x1000
584585

585586
/*
586587
* Flags used by ext4_free_blocks

0 commit comments

Comments
 (0)