Reorder metadata updating patter in WB mode
In WB mode metadata should be updated only if the actuall data had been saved on disk. Otherwise metadata might be flushed too early and consequently data corruption might occur. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
847f5f1174
commit
0192ce23dd
@ -74,6 +74,8 @@ static int ocf_write_wb_do_flush_metadata(struct ocf_request *req)
|
||||
|
||||
env_atomic_set(&req->req_remaining, 1); /* One core IO */
|
||||
|
||||
_ocf_write_wb_update_bits(req);
|
||||
|
||||
if (req->info.flush_metadata) {
|
||||
OCF_DEBUG_RQ(req, "Flush metadata");
|
||||
ocf_metadata_flush_do_asynch(cache, req,
|
||||
@ -152,9 +154,6 @@ int ocf_write_wb_do(struct ocf_request *req)
|
||||
/* Get OCF request - increase reference counter */
|
||||
ocf_req_get(req);
|
||||
|
||||
/* Update status bits */
|
||||
_ocf_write_wb_update_bits(req);
|
||||
|
||||
/* Submit IO */
|
||||
_ocf_write_wb_submit(req);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user