Whamcloud - gitweb
LU-15637 llite: Fix use of uninitialized fields 76/46776/3
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 10 Mar 2022 03:16:50 +0000 (22:16 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 27 Mar 2022 03:55:15 +0000 (03:55 +0000)
commit9884f37985c1108fb8106a5d8615c2c35f3c6a71
tree61e87442de7d3371f3e59deb94220155098faa36
parentd8012811cc6ff9c7f0fb1ddfec9461e9ff963e54
LU-15637 llite: Fix use of uninitialized fields

We use data from ci_rw to set io_start_index and
io_end_index, which is a problem for mmap because mmap does
not use ci_rw.

When ci_rand_read is set or readahead is disabled, we use
these values to decide how much data to read.

ci_rw is uninitialized, and if the values are non-zero,
we may try to read data beyond the locks we took for our
I/O.

If there is no lock (either because there was never one or
it was cancelled), this results in an LBUG in
osc_req_attr_set when it verifies the pages are covered by
a lock.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: If7c8d2eb87a28bf76a6f959e7be7bf636c887cfe
Reviewed-on: https://review.whamcloud.com/46776
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/rw.c