/* We treat this entry as if it doesn't exist */
                if (test_bit(BTRFS_ORDERED_UPDATED_ISIZE, &test->flags))
                        continue;
-               if (test->file_offset + test->len <= disk_i_size)
+
+               if (entry_end(test) <= disk_i_size)
                        break;
                if (test->file_offset >= i_size)
                        break;
-               if (entry_end(test) > disk_i_size) {
-                       /*
-                        * we don't update disk_i_size now, so record this
-                        * undealt i_size. Or we will not know the real
-                        * i_size.
-                        */
-                       if (test->outstanding_isize < offset)
-                               test->outstanding_isize = offset;
-                       if (ordered &&
-                           ordered->outstanding_isize >
-                           test->outstanding_isize)
-                               test->outstanding_isize =
-                                               ordered->outstanding_isize;
-                       goto out;
-               }
+
+               /*
+                * We don't update disk_i_size now, so record this undealt
+                * i_size. Or we will not know the real i_size.
+                */
+               if (test->outstanding_isize < offset)
+                       test->outstanding_isize = offset;
+               if (ordered &&
+                   ordered->outstanding_isize > test->outstanding_isize)
+                       test->outstanding_isize = ordered->outstanding_isize;
+               goto out;
        }
        new_i_size = min_t(u64, offset, i_size);