Whamcloud - gitweb
LU-15637 llite: Fix use of uninitialized fields
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 10 Mar 2022 19:38:30 +0000 (14:38 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 31 Mar 2022 04:18:48 +0000 (04:18 +0000)
commitd6ca3398c138a2dbf7fe27fa48385c8461a443ea
tree82a22f2e4d4fa332a9868a2297e4f63eec0e6447
parentf1e322a33f58d96c5d6eb12e5eb2768517d3f5f8
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.

Lustre-change: https://review.whamcloud.com/46776/
Lustre-commit: 58fd9b2522325d77643430e361bee5cb625d4bbc (tbd)

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