Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcmur: fail cross-device XCOPY requests #644

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tcmur_cmd_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,18 @@ static int xcopy_parse_parameter_list(struct tcmu_device *dev,
if (ret != TCMU_STS_OK)
goto err;

/*
* tcmu-runner can't determine whether the device(s) referred to in an
* XCOPY request should be accessible to the initiator via transport
* settings, ACLs, etc. XXX Consequently, we need to fail any
* cross-device requests for safety reasons.
*/
if (dev != xcopy->src_dev || dev != xcopy->dst_dev) {
tcmu_dev_err(dev, "Cross-device XCOPY not supported\n");
ret = TCMU_STS_CP_TGT_DEV_NOTCONN;
goto err;
}

if (tcmu_dev_get_block_size(xcopy->src_dev) !=
tcmu_dev_get_block_size(xcopy->dst_dev)) {
tcmu_dev_err(dev, "The block size of src dev %u != dst dev %u\n",
Expand Down