ext4: Properly initialize the buffer_head state
These struct buffer_heads are allocated on the stack (and hence are initialized with stack garbage). They are only used to call a get_blocks() function, so that's mostly OK, but b_state must be initialized to be 0 so we don't have any unexpected BH_* flags set by accident, such as BH_Unwritten or BH_Delay. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
committed by
Theodore Ts'o
parent
9fa7eb283c
commit
79ffab3439
@@ -3150,6 +3150,7 @@ retry:
|
||||
ret = PTR_ERR(handle);
|
||||
break;
|
||||
}
|
||||
map_bh.b_state = 0;
|
||||
ret = ext4_get_blocks_wrap(handle, inode, block,
|
||||
max_blocks, &map_bh,
|
||||
EXT4_CREATE_UNINITIALIZED_EXT, 0, 0);
|
||||
|
Reference in New Issue
Block a user