On 7:58 12/05, Christoph Hellwig wrote: > On Sat, May 09, 2020 at 11:06:01PM -0500, Goldwyn Rodrigues wrote: > > > > We cannot perform data reservations and release in iomap_begin() and > > > > iomap_end() for performance and accounting issues. > > > > > > So just drop "btrfs: Use ->iomap_end() instead of btrfs_dio_data" > > > from the series and be done with it? > > > > We are using current->journal_info for fdatawrite sequence hence using > > that as a temporary pointer does not work since iomap_dio_rw() performs > > the fdatawrite sequence. > > Ok. but in that case they never really should have been separate patches. > Yes, I realized it when I was dealing with this problem. > Can someone help me to understand who consumes the reservation create by > btrfs_delalloc_reserve_space? Most importantly if this is done by > something called from btrfs_dio_iomap_begin or from btrfs_submit_direct. It is consumed in btrfs_finish_ordered_io()->..btrfs_cow_block()->..btrfs_use_block_rsv(). So, it is a queued work from __end_write_update_ordered(). I am also understanding the way this reservation system works so I may not be 100% correct. More details are in the starting comments of fs/btrfs/block-rsv.c -- Goldwyn
