mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 19:21:26 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -2466,9 +2466,9 @@ static int cmnd_abort_pre_checks(struct iscsi_cmnd *req, int *status)
|
||||
* Management function request is outside the valid CmdSN window,
|
||||
* then targets must return the "Task does not exist" response.
|
||||
*
|
||||
* 128 seems to be a good "window".
|
||||
* 2048 seems to be a good "window".
|
||||
*/
|
||||
if (between(req_hdr->ref_cmd_sn, req_hdr->cmd_sn - 128,
|
||||
if (between(req_hdr->ref_cmd_sn, req_hdr->cmd_sn - 2048,
|
||||
req_hdr->cmd_sn)) {
|
||||
*status = ISCSI_RESPONSE_FUNCTION_COMPLETE;
|
||||
res = 0;
|
||||
|
||||
@@ -631,6 +631,40 @@ static inline void *vzalloc(unsigned long size)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/unaligned.h> */
|
||||
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5
|
||||
static inline uint16_t get_unaligned_be16(const void *p)
|
||||
{
|
||||
return be16_to_cpu(get_unaligned((__be16 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be16(uint16_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be16(i), (__be16 *)p);
|
||||
}
|
||||
|
||||
static inline uint32_t get_unaligned_be32(const void *p)
|
||||
{
|
||||
return be32_to_cpu(get_unaligned((__be32 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be32(uint32_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be32(i), (__be32 *)p);
|
||||
}
|
||||
|
||||
static inline uint64_t get_unaligned_be64(const void *p)
|
||||
{
|
||||
return be64_to_cpu(get_unaligned((__be64 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be64(uint64_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be64(i), (__be64 *)p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <scsi/scsi_cmnd.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
|
||||
|
||||
@@ -4660,38 +4660,6 @@ static inline __be16 scst_cmd_get_dif_app_tag(struct scst_cmd *cmd,
|
||||
return cmd->dev->dev_dif_static_app_tag;
|
||||
}
|
||||
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5
|
||||
static inline uint16_t get_unaligned_be16(const void *p)
|
||||
{
|
||||
return be16_to_cpu(get_unaligned((__be16 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be16(uint16_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be16(i), (__be16 *)p);
|
||||
}
|
||||
|
||||
static inline uint32_t get_unaligned_be32(const void *p)
|
||||
{
|
||||
return be32_to_cpu(get_unaligned((__be32 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be32(uint32_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be32(i), (__be32 *)p);
|
||||
}
|
||||
|
||||
static inline uint64_t get_unaligned_be64(const void *p)
|
||||
{
|
||||
return be64_to_cpu(get_unaligned((__be64 *)p));
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be64(uint64_t i, void *p)
|
||||
{
|
||||
put_unaligned(cpu_to_be64(i), (__be64 *)p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns T10-PI type 2 expected initial reference tag as LBA, i.e. converted
|
||||
* into CPU endianness. Valid only with protection type 2.
|
||||
|
||||
@@ -7366,7 +7366,7 @@ static void blockio_on_alua_state_change_finish(struct scst_device *dev,
|
||||
int rc = 0;
|
||||
|
||||
TRACE_MGMT_DBG("ALUA state change from %s to %s finished (dev %s), "
|
||||
"reopenning FD", scst_alua_state_name(old_state),
|
||||
"reopening FD", scst_alua_state_name(old_state),
|
||||
scst_alua_state_name(new_state), dev->virt_name);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1019,11 +1019,17 @@ out_set_fs:
|
||||
set_fs(old_fs);
|
||||
|
||||
out:
|
||||
if (res != 0)
|
||||
if (res != 0) {
|
||||
PRINT_CRIT_ERROR("Unable to save persistent information "
|
||||
"(device %s)", dev->virt_name);
|
||||
/*
|
||||
* It's safer to not return any error to the initiator and expect
|
||||
* operator's intervention to be able to save the PR's state next
|
||||
* time, than to screw up all the interactions with this initiator.
|
||||
*/
|
||||
}
|
||||
|
||||
TRACE_EXIT_RES(res);
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
|
||||
write_error:
|
||||
|
||||
Reference in New Issue
Block a user