Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't propagate bio flags to OCF for discard I/O
One of the steps of discarding data in cache is invalidating OCF metadata. If a cache line which is supposed to be discarded is dirty, invalidating it will require flushing metadata. Unfortunately, OCF allocates flushing requests with the exactly the same flags as the original IO (in this case discard flag is set) so the page on the disk is discarded instead of being flushed. In case of power failure occurring before the metadata is flushed to the disk, the data may be corrupted even if recovery will succeed. Disabling propagation of original I/O flags for discard requests solves this problem. Signed-off-by: Michal Mielewczyk <[email protected]> Signed-off-by: Robert Baldyga <[email protected]>
- Loading branch information