Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0fb5b1fb authored by Martin K. Petersen's avatar Martin K. Petersen
Browse files

block/sd: Return -EREMOTEIO when WRITE SAME and DISCARD are disabled



When a storage device rejects a WRITE SAME command we will disable write
same functionality for the device and return -EREMOTEIO to the block
layer. -EREMOTEIO will in turn prevent DM from retrying the I/O and/or
failing the path.

Yiwen Jiang discovered a small race where WRITE SAME requests issued
simultaneously would cause -EIO to be returned. This happened because
any requests being prepared after WRITE SAME had been disabled for the
device caused us to return BLKPREP_KILL. The latter caused the block
layer to return -EIO upon completion.

To overcome this we introduce BLKPREP_INVALID which indicates that this
is an invalid request for the device. blk_peek_request() is modified to
return -EREMOTEIO in that case.

Reported-by: default avatarYiwen Jiang <jiangyiwen@huawei.com>
Suggested-by: default avatarMike Snitzer <snitzer@redhat.com>
Reviewed-by: default avatarHannes Reinicke <hare@suse.de>
Reviewed-by: default avatarEwan Milne <emilne@redhat.com>
Reviewed-by: default avatarYiwen Jiang <jiangyiwen@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 82c43310
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment