add patch fix-sleep-in-atomic-context-in-grab_mapping_entry
[ext4-patch-queue.git] / remove-another-test-in-ext4_alloc_file_blocks
blobcdf177e90ccce5db70f9110424ba44aed845ac9a
1 ext4: remove another test in ext4_alloc_file_blocks()
3 From: Dan Carpenter <dan.carpenter@oracle.com>
5 Before commit c3fe493ccdb1 ('ext4: remove unneeded test in
6 ext4_alloc_file_blocks()') then it was possible for "depth" to be -1
7 but now, it's not possible that it is negative.
9 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 Reviewed-by: Jan Kara <jack@suse.cz>
12 ---
13 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
14 index c930a01..dca394c 100644
15 --- a/fs/ext4/extents.c
16 +++ b/fs/ext4/extents.c
17 @@ -4701,7 +4701,7 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset,
18                 /*
19                  * Recalculate credits when extent tree depth changes.
20                  */
21 -               if (depth >= 0 && depth != ext_depth(inode)) {
22 +               if (depth != ext_depth(inode)) {
23                         credits = ext4_chunk_trans_blocks(inode, len);
24                         depth = ext_depth(inode);
25                 }