On 2020/10/27 下午6:29, David Sterba wrote: > On Wed, Oct 21, 2020 at 02:24:59PM +0800, Qu Wenruo wrote: >> In end_bio_extent_readpage() we had a strange dance around >> extent_start/extent_len. >> >> The truth is, no matter what we're doing using those two variable, the >> end result is just the same, clear the EXTENT_LOCKED bit and if needed >> set the EXTENT_UPTODATE bit for the io_tree. >> >> This doesn't need the complex dance, we can do it pretty easily by just >> calling endio_readpage_release_extent() for each bvec. >> >> This greatly streamlines the code. > > Yes it does, the old code is a series of conditions and new code is just > one call but it's hard to see why this is correct. Can you please write > some guidance, what are the invariants or how does the logic simplify? > What you write above is a summary but for review I'd need something to > follow so I don't have to spend too much time reading just this patch. > Thanks. > Sorry, I should add more explanation on that, would add that in next update. Thanks, Qu