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 <michal.mielewczyk@intel.com> Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
f9a2846224
commit
e4d4750f96
@ -356,9 +356,7 @@ static void blkdev_handle_discard(struct bd_object *bvol, struct bio *bio)
|
||||
|
||||
io = ocf_volume_new_io(bvol->front_volume, queue,
|
||||
CAS_BIO_BISECTOR(bio) << SECTOR_SHIFT,
|
||||
CAS_BIO_BISIZE(bio), OCF_WRITE, 0,
|
||||
CAS_CLEAR_FLUSH(CAS_BIO_OP_FLAGS(bio)));
|
||||
|
||||
CAS_BIO_BISIZE(bio), OCF_WRITE, 0, 0);
|
||||
if (!io) {
|
||||
CAS_PRINT_RL(KERN_CRIT
|
||||
"Out of memory. Ending IO processing.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user