Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull SCSI target fixes from Nicholas Bellinger:
"These are mostly minor fixes this time around. The iscsi-target CHAP
big-endian bugfix and bump FD_MAX_SECTORS=2048 default patch to allow
1MB sized I/Os for FILEIO backends on >= v3.5 code are both CC'ed to
stable.

Also, there is a persistent reservations regression that has recently
been reported for >= v3.8.x code, that is currently being tracked down
for v3.9."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target/pscsi: Reject cross page boundary case in pscsi_map_sg
target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os
tcm_vhost: Flush vhost_work in vhost_scsi_flush()
tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint()
target: fix possible memory leak in core_tpg_register()
target/iscsi: Fix mutual CHAP auth on big-endian arches
target_core_sbc: use noop for SYNCHRONIZE_CACHE

+29 -12
+4 -1
drivers/target/iscsi/iscsi_target_auth.c
··· 166 166 { 167 167 char *endptr; 168 168 unsigned long id; 169 + unsigned char id_as_uchar; 169 170 unsigned char digest[MD5_SIGNATURE_SIZE]; 170 171 unsigned char type, response[MD5_SIGNATURE_SIZE * 2 + 2]; 171 172 unsigned char identifier[10], *challenge = NULL; ··· 356 355 goto out; 357 356 } 358 357 359 - sg_init_one(&sg, &id, 1); 358 + /* To handle both endiannesses */ 359 + id_as_uchar = id; 360 + sg_init_one(&sg, &id_as_uchar, 1); 360 361 ret = crypto_hash_update(&desc, &sg, 1); 361 362 if (ret < 0) { 362 363 pr_err("crypto_hash_update() failed for id\n");
+1 -1
drivers/target/target_core_file.h
··· 7 7 #define FD_DEVICE_QUEUE_DEPTH 32 8 8 #define FD_MAX_DEVICE_QUEUE_DEPTH 128 9 9 #define FD_BLOCKSIZE 512 10 - #define FD_MAX_SECTORS 1024 10 + #define FD_MAX_SECTORS 2048 11 11 12 12 #define RRF_EMULATE_CDB 0x01 13 13 #define RRF_GOT_LBA 0x02
+8 -3
drivers/target/target_core_pscsi.c
··· 883 883 pr_debug("PSCSI: i: %d page: %p len: %d off: %d\n", i, 884 884 page, len, off); 885 885 886 - while (len > 0 && data_len > 0) { 886 + /* 887 + * We only have one page of data in each sg element, 888 + * we can not cross a page boundary. 889 + */ 890 + if (off + len > PAGE_SIZE) 891 + goto fail; 892 + 893 + if (len > 0 && data_len > 0) { 887 894 bytes = min_t(unsigned int, len, PAGE_SIZE - off); 888 895 bytes = min(bytes, data_len); 889 896 ··· 947 940 bio = NULL; 948 941 } 949 942 950 - len -= bytes; 951 943 data_len -= bytes; 952 - off = 0; 953 944 } 954 945 } 955 946
+5 -2
drivers/target/target_core_sbc.c
··· 464 464 break; 465 465 case SYNCHRONIZE_CACHE: 466 466 case SYNCHRONIZE_CACHE_16: 467 - if (!ops->execute_sync_cache) 468 - return TCM_UNSUPPORTED_SCSI_OPCODE; 467 + if (!ops->execute_sync_cache) { 468 + size = 0; 469 + cmd->execute_cmd = sbc_emulate_noop; 470 + break; 471 + } 469 472 470 473 /* 471 474 * Extract LBA and range to be flushed for emulated SYNCHRONIZE_CACHE
+2 -1
drivers/target/target_core_tpg.c
··· 711 711 712 712 if (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) { 713 713 if (core_tpg_setup_virtual_lun0(se_tpg) < 0) { 714 - kfree(se_tpg); 714 + array_free(se_tpg->tpg_lun_list, 715 + TRANSPORT_MAX_LUNS_PER_TPG); 715 716 return -ENOMEM; 716 717 } 717 718 }
+9 -4
drivers/vhost/tcm_vhost.c
··· 850 850 for (index = 0; index < vs->dev.nvqs; ++index) { 851 851 if (!vhost_vq_access_ok(&vs->vqs[index])) { 852 852 ret = -EFAULT; 853 - goto err; 853 + goto err_dev; 854 854 } 855 855 } 856 856 for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) { ··· 860 860 if (!tv_tpg) 861 861 continue; 862 862 863 + mutex_lock(&tv_tpg->tv_tpg_mutex); 863 864 tv_tport = tv_tpg->tport; 864 865 if (!tv_tport) { 865 866 ret = -ENODEV; 866 - goto err; 867 + goto err_tpg; 867 868 } 868 869 869 870 if (strcmp(tv_tport->tport_name, t->vhost_wwpn)) { ··· 873 872 tv_tport->tport_name, tv_tpg->tport_tpgt, 874 873 t->vhost_wwpn, t->vhost_tpgt); 875 874 ret = -EINVAL; 876 - goto err; 875 + goto err_tpg; 877 876 } 878 877 tv_tpg->tv_tpg_vhost_count--; 879 878 vs->vs_tpg[target] = NULL; 880 879 vs->vs_endpoint = false; 880 + mutex_unlock(&tv_tpg->tv_tpg_mutex); 881 881 } 882 882 mutex_unlock(&vs->dev.mutex); 883 883 return 0; 884 884 885 - err: 885 + err_tpg: 886 + mutex_unlock(&tv_tpg->tv_tpg_mutex); 887 + err_dev: 886 888 mutex_unlock(&vs->dev.mutex); 887 889 return ret; 888 890 } ··· 941 937 942 938 for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) 943 939 vhost_scsi_flush_vq(vs, i); 940 + vhost_work_flush(&vs->dev, &vs->vs_completion_work); 944 941 } 945 942 946 943 static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)