diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index f76db72ff..a7ff50829 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -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; diff --git a/scst/include/backport.h b/scst/include/backport.h index 8e1a6afa0..c7c923eae 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -631,6 +631,40 @@ static inline void *vzalloc(unsigned long size) } #endif +/* */ + +#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 + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) diff --git a/scst/include/scst.h b/scst/include/scst.h index f52dc46d8..e0aa9bdb9 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -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. diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 5b5147013..24ca80237 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -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); /* diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 1627e792d..db2d8fdad 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -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: