]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_repair: don't let bplist index go negative in prefetch
authorEric Sandeen <sandeen@redhat.com>
Tue, 20 May 2014 08:30:44 +0000 (18:30 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 20 May 2014 08:30:44 +0000 (18:30 +1000)
commit2c350101393f7effcdce815f20d97f239bf2a78c
treede2a4c4a7bd9808034abdcf46d0d1b93906fa603
parent66260204ebbb1dce12f910b71de3abad73a2a805
xfs_repair: don't let bplist index go negative in prefetch

After:

bbd3275 repair: don't unlock prefetch tree to read discontig buffers

Coverity spotted that it's possible for us to arrive at the loop
below with num == 1, and then we decrement it to 0, and try to
index bplist[num-1].

I think this was possible before the change, i.e. it's probably
not a regression.

Fix this by not trying to shrink the window unless we have
more than one buffer in the array.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/prefetch.c