ll_use_fast_io() is used to check wheather we could use fast IO.
Since it is called in fast path, we don't hold ras_lock to protect
access, there might have the race @ras_stride_bytes is reset after
stride_io_mode() check.
Fixes:
9e4c5bdaaec5 ("LU-12644 llite: try fast io for stride io correctly")
Change-Id: If57ad074ecfa6560cc527f9f52e7adc2b0a456fd
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/38545
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
unsigned long fast_read_pages =
max(RA_REMAIN_WINDOW_MIN, ras->ras_rpc_pages);
loff_t skip_pages;
+ loff_t stride_bytes = ras->ras_stride_bytes;
- if (stride_io_mode(ras)) {
+ if (stride_io_mode(ras) && stride_bytes) {
skip_pages = (ras->ras_stride_length +
- ras->ras_stride_bytes - 1) / ras->ras_stride_bytes;
+ ras->ras_stride_bytes - 1) / stride_bytes;
skip_pages *= fast_read_pages;
} else {
skip_pages = fast_read_pages;