summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Vater2025-10-08 09:33:43 +0200
committerSebastian Vater2025-10-08 09:33:43 +0200
commit017a7d6d8d0084ed86f15d3063bd6ecafcd6d412 (patch)
treee98d9c016e1d223de96248d604d0c0b325e3792a
parentFixes to iSCSI DNBD3 proxy uplink handling. (diff)
downloaddnbd3-017a7d6d8d0084ed86f15d3063bd6ecafcd6d412.tar.gz
dnbd3-017a7d6d8d0084ed86f15d3063bd6ecafcd6d412.tar.xz
dnbd3-017a7d6d8d0084ed86f15d3063bd6ecafcd6d412.zip
Fixed iSCSI spelling typo in example server.conf and iscsi.conf. Finally, removed enforced debug socket time out of one hour.
-rw-r--r--pkg/config/iscsi.conf2
-rw-r--r--pkg/config/server.conf2
-rw-r--r--src/server/iscsi.c56
3 files changed, 30 insertions, 30 deletions
diff --git a/pkg/config/iscsi.conf b/pkg/config/iscsi.conf
index a3b1e8d..79eab48 100644
--- a/pkg/config/iscsi.conf
+++ b/pkg/config/iscsi.conf
@@ -188,7 +188,7 @@ Removable=true
; yet. Default is false
UNMAP=false
-; Device is emulated as non-rotating (e.g. SSD or NVMe), recommended to enable if image is stoed
+; Device is emulated as non-rotating (e.g. SSD or NVMe), recommended to enable if image is stored
; on a non-rotating device like a SSD or NVMe. Default is false
NoRotation=false
diff --git a/pkg/config/server.conf b/pkg/config/server.conf
index 78ec3e7..1e92963 100644
--- a/pkg/config/server.conf
+++ b/pkg/config/server.conf
@@ -273,7 +273,7 @@ Removable=true
; yet. Default is false
UNMAP=false
-; Device is emulated as non-rotating (e.g. SSD or NVMe), recommended to enable if image is stoed
+; Device is emulated as non-rotating (e.g. SSD or NVMe), recommended to enable if image is stored
; on a non-rotating device like a SSD or NVMe. Default is false
NoRotation=false
diff --git a/src/server/iscsi.c b/src/server/iscsi.c
index e9b0fc1..6fb454e 100644
--- a/src/server/iscsi.c
+++ b/src/server/iscsi.c
@@ -5242,32 +5242,6 @@ static int iscsi_scsi_emu_queue_io_wait(iscsi_scsi_task *scsi_task, iscsi_scsi_e
}
/**
- * @brief Called when data requested via an uplink server has arrived.
- *
- * This function is used to retrieve
- * block data which is NOT locally
- * available.
- *
- * @param[in] data Pointer to related scsi_task. May NOT
- * be NULL, so be careful.
- * @param[in] handle Uplink handle.
- * @param[in] start Start of range in bytes.
- * @param[in] length Length of range in bytes, as passed to
- * uplink_request().
- * @param[in] buffer Data for requested range.
- */
-static void iscsi_uplink_callback(void *data, uint64_t handle UNUSED, uint64_t start UNUSED, uint32_t length, const char *buffer)
-{
- iscsi_scsi_task *scsi_task = (iscsi_scsi_task *) data;
-
- memcpy( scsi_task->buf, buffer, length );
-
- pthread_mutex_lock( &scsi_task->uplink_mutex );
- pthread_cond_signal( &scsi_task->uplink_cond );
- pthread_mutex_unlock( &scsi_task->uplink_mutex );
-}
-
-/**
* @brief Converts offset and length specified by a block size to offset and length in bytes.
*
* This function uses bit shifting if
@@ -5297,6 +5271,32 @@ static uint64_t iscsi_scsi_emu_blocks_to_bytes(uint64_t *offset_bytes, const uin
}
/**
+ * @brief Called when data requested via an uplink server has arrived.
+ *
+ * This function is used to retrieve
+ * block data which is NOT locally
+ * available.
+ *
+ * @param[in] data Pointer to related scsi_task. May NOT
+ * be NULL, so be careful.
+ * @param[in] handle Uplink handle.
+ * @param[in] start Start of range in bytes.
+ * @param[in] length Length of range in bytes, as passed to
+ * uplink_request().
+ * @param[in] buffer Data for requested range.
+ */
+static void iscsi_uplink_callback(void *data, uint64_t handle UNUSED, uint64_t start UNUSED, uint32_t length, const char *buffer)
+{
+ iscsi_scsi_task *scsi_task = (iscsi_scsi_task *) data;
+
+ memcpy( scsi_task->buf, buffer, length );
+
+ pthread_mutex_lock( &scsi_task->uplink_mutex );
+ pthread_cond_signal( &scsi_task->uplink_cond );
+ pthread_mutex_unlock( &scsi_task->uplink_mutex );
+}
+
+/**
* @brief Reads a number of blocks from a block offset of a DNBD3 image to a specified buffer.
*
* This function enqueues the I/O read
@@ -8860,7 +8860,7 @@ iscsi_target_node *iscsi_target_node_find(uint8_t *target_name)
target = iscsi_target_node_create( target_name, NULL, 0, image->rid, 16U, 0, 0L, 0, 0 );
if ( target == NULL ) {
- logadd( LOG_ERROR, "iscsi_target_node_find: Out of memory while allocating iSCSI target node" );
+ logadd( LOG_ERROR, "iscsi_target_node_find: iSCSI target node not found" );
pthread_rwlock_unlock( &iscsi_globvec->target_nodes_rwlock );
@@ -13855,7 +13855,7 @@ int iscsi_connection_pdu_handle(iscsi_connection *conn)
void iscsi_connection_handle(dnbd3_client_t *client, const dnbd3_request_t *request, const int len)
{
_Static_assert( sizeof(dnbd3_request_t) <= sizeof(struct iscsi_bhs_packet), "DNBD3 request size larger than iSCSI BHS packet data size - Manual intervention required!" );
- sock_setTimeout( client->sock, 1000L * 3600L ); // TODO: Remove after finishing iSCSI implementation
+ // sock_setTimeout( client->sock, 1000L * 3600L ); // TODO: Remove after finishing iSCSI implementation
pthread_rwlock_rdlock( &iscsi_globvec_rwlock );