ceph: fix overflowed value issue in ceph_submit_write()
The Coverity Scan service has detected overflowed value
issue in ceph_submit_write() [1]. The CID
1646339 defect
contains explanation: "The overflowed value due to
arithmetic on constants is too small or unexpectedly
negative, causing incorrect computations.
In ceph_submit_write: Integer overflow occurs in
arithmetic on constant operands (CWE-190)".
This patch adds a check ceph_wbc->locked_pages on
equality to zero and it exits function if it has
zero value. Also, it introduces a processed_pages
variable with the goal of assigning the number of
processed pages and checking this number on
equality to zero. The check of processed_pages
variable on equality to zero should protect from
overflowed value of index that selects page in
ceph_wbc->pages[index] array.
[1] https://scan5.scan.coverity.com/#/project-view/64304/10063?selectedIssue=
1646339
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>