Whamcloud - gitweb
LU-15637 llite: Fix use of uninitialized fields 76/46776/1
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 10 Mar 2022 03:16:50 +0000 (22:16 -0500)
committerPatrick Farrell <pfarrell@whamcloud.com>
Thu, 10 Mar 2022 03:16:50 +0000 (22:16 -0500)
commit58fd9b2522325d77643430e361bee5cb625d4bbc
tree068f0553bff03097e3f83bf4177cf2383bc4e560
parent06134ff9addec8c74af78dd0f361f503ef8d3ba6
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
lustre/llite/rw.c