On Fri, Jan 18, 2019 at 10:19:54AM +0800, Qu Wenruo wrote: > This BUG_ON() is really just a crappy way to workaround the _must_check > attribute of submit_one_bio(). > > Now kill the BUG_ON() and allow flush_write_bio() to return error > number. > > Also add _must_check attribute to flush_write_bio(), and modify all > callers to handle the possible error returned. Can you please spit that to several steps: 1. handle errors in submit_one_bio or pass it to the callers ie. drop the BUG_ON and move it to all callers 2. in all callers do ret = flush_write_bio(...) BUG_ON(ret) So now it's one level up in the call chain and up to all callers to handle the errors properly. The code is equivalent to the previous state, though there are more BUG_ONs. 3. one patch per function that handles errors of flush_write_bio, ie. actual replacement of BUG_ON with if (ret < 0) etc As there are several different functions, each has own things to clean up and it's easier to review them one by one. Sometimes it's necessary to check more callers and keeping multiple contexts in mind at once does not work very well. Counting all the affected functions: lock_extent_buffer_for_io(struct extent_buffer *eb, btree_write_cache_pages(struct address_space *mapping, extent_write_cache_pages(struct address_space *mapping, extent_write_full_page(struct page *page, struct writeback_control *wbc) extent_write_locked_range(struct inode *inode, u64 start, u64 end, extent_writepages(struct address_space *mapping, the 3rd point would produce 6 patches.
