提交 49850a14 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target fixes from Nicholas Bellinger:
 "Just a few small fixes:

  Two from Andy, the first addresses a v4.0 target specific regression
  to a user visible configfs attribute, and the second adds a set of
  missing brackets around IPv6 discovery portal information within
  iscsi-target.

  And one from Mike that fixes an OOPs regression in traditional
  iscsi-target when an iovec allocation fails, that has been present
  since v3.10.y code.  (CC'd to stable)"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iscsi target: fix oops when adding reject pdu
  iscsi-target: TargetAddress in SendTargets should bracket ipv6 addresses
  target: Allow userspace to write 1 to attrib/emulate_fua_write
...@@ -1181,7 +1181,7 @@ iscsit_handle_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, ...@@ -1181,7 +1181,7 @@ iscsit_handle_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
* traditional iSCSI block I/O. * traditional iSCSI block I/O.
*/ */
if (iscsit_allocate_iovecs(cmd) < 0) { if (iscsit_allocate_iovecs(cmd) < 0) {
return iscsit_add_reject_cmd(cmd, return iscsit_reject_cmd(cmd,
ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf);
} }
immed_data = cmd->immediate_data; immed_data = cmd->immediate_data;
...@@ -3468,6 +3468,7 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd, ...@@ -3468,6 +3468,7 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
tpg_np_list) { tpg_np_list) {
struct iscsi_np *np = tpg_np->tpg_np; struct iscsi_np *np = tpg_np->tpg_np;
bool inaddr_any = iscsit_check_inaddr_any(np); bool inaddr_any = iscsit_check_inaddr_any(np);
char *fmt_str;
if (np->np_network_transport != network_transport) if (np->np_network_transport != network_transport)
continue; continue;
...@@ -3495,8 +3496,12 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd, ...@@ -3495,8 +3496,12 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
} }
} }
len = sprintf(buf, "TargetAddress=" if (np->np_sockaddr.ss_family == AF_INET6)
"%s:%hu,%hu", fmt_str = "TargetAddress=[%s]:%hu,%hu";
else
fmt_str = "TargetAddress=%s:%hu,%hu";
len = sprintf(buf, fmt_str,
inaddr_any ? conn->local_ip : np->np_ip, inaddr_any ? conn->local_ip : np->np_ip,
np->np_port, np->np_port,
tpg->tpgt); tpg->tpgt);
......
...@@ -781,8 +781,8 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag) ...@@ -781,8 +781,8 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
} }
if (flag && if (flag &&
dev->transport->get_write_cache) { dev->transport->get_write_cache) {
pr_err("emulate_fua_write not supported for this device\n"); pr_warn("emulate_fua_write not supported for this device, ignoring\n");
return -EINVAL; return 0;
} }
if (dev->export_count) { if (dev->export_count) {
pr_err("emulate_fua_write cannot be changed with active" pr_err("emulate_fua_write cannot be changed with active"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册