On 7/26/18 1:35 PM, stockhausen@xxxxxxxxxxx wrote: > ondemand_readahead() checks bdi->io_pages to cap the maximum pages > that need to be processed. This works until the readit section. If > we would do an async only readahead (async size = sync size) and > target is at beginning of window we expand the pages by another > get_next_ra_size() pages. Btrace for large reads shows that kernel > always issues a doubled size read at the beginning of processing. > Add an additional check for io_pages in the lower part of the func. > The fix helps devices that hard limit bio pages and rely on proper > handling of max_hw_read_sectors (e.g. older FusionIO cards). For > that reason it could qualify for stable. Good catch, this looks correct to me. I'm going to shove this towards 4.19 and mark it stable, that should give us enough testing time on it. -- Jens Axboe