On 1.02.20 г. 0:36 ч., Josef Bacik wrote:
> Right now if the space is free'd up after the ordered extents complete
> (which is likely since the reservations are held until they complete),
> we would do extra delalloc flushing before we'd notice that we didn't
> have any more tickets. Fix this by moving the tickets check after our
> wait_ordered_extents check.
>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
This patch makes sense only for metadata. Is this your intention -
tweaking the metadata change behavior? Correct me if I'm wrong but
btrfs_start_delalloc_roots from previous patch will essentially call
btrfs_run_delalloc_range for the roots which will create ordered extents in:
btrfs_run_delalloc_range
cow_file_range
add_ordered_extents
Following page writeout, from the endio routines we'll eventually do:
finish_ordered_fn
btrfs_finish_ordered_io
insert_reserved_file_extent
btrfs_alloc_reserved_file_extent
create delayed ref <---- after the delayed extent is run this will
free some data space. But this happens in transaction commit context and
not when runnig ordered extents
btrfs_remove_ordered_extent
btrfs_delalloc_release_metadata <- this is only for metadata
btrfs_inode_rsv_release
__btrfs_block_rsv_release <-- frees metadata but not data?
I'm looking those patches thinking every change should be pertinent to
data space but apparently it's not. If so I think it will be best if you
update the cover letter for V2 to mention which patches can go in
independently or give more context why this particular patch is
pertinent to data flush.