add patch fix-return-value-of-ext4_do_update_inode
[ext4-patch-queue.git] / fix-flag-aliasing-in-ext4.h
blob89dc582c69e021494b6257facb3beef778d694a6
1 ext4: fix accidental flag aliasing in ext4_map_blocks flags
3 Commit b8a8684502a0f introduced an accidental flag aliasing between
4 EXT4_EX_NOCACHE and EXT4_GET_BLOCKS_CONVERT_UNWRITTEN.
6 Fortunately, this didn't introduce any untorward side effects --- we
7 got lucky. Nevertheless, fix this and leave a warning to hopefully
8 avoid this from happening in the future.
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 ---
12 fs/ext4/ext4.h | 5 +++--
13 1 file changed, 3 insertions(+), 2 deletions(-)
15 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
16 index cf3ad75..550b4f9 100644
17 --- a/fs/ext4/ext4.h
18 +++ b/fs/ext4/ext4.h
19 @@ -569,6 +569,7 @@ enum {
20 #define EXT4_GET_BLOCKS_NO_PUT_HOLE 0x0200
21 /* Convert written extents to unwritten */
22 #define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN 0x0400
23 +/* DO NOT ASSIGN ADDITIONAL FLAG VALUES WITHOUT ADJUSTING THE FLAGS BELOW */
26 * The bit position of these flags must not overlap with any of the
27 @@ -579,8 +580,8 @@ enum {
28 * caching the extents when reading from the extent tree while a
29 * truncate or punch hole operation is in progress.
31 -#define EXT4_EX_NOCACHE 0x0400
32 -#define EXT4_EX_FORCE_CACHE 0x0800
33 +#define EXT4_EX_NOCACHE 0x0800
34 +#define EXT4_EX_FORCE_CACHE 0x1000
37 * Flags used by ext4_free_blocks