From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Hannes Reinecke <hare@suse.com>,
Douglas Gilbert <dgilbert@interlog.com>,
Bart Van Assche <bvanassche@acm.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.19 025/114] scsi: tracing: Fix handling of TRANSFER LENGTH == 0 for READ(6) and WRITE(6)
Date: Thu, 2 Jan 2020 23:06:37 +0100 [thread overview]
Message-ID: <20200102220031.656066896@linuxfoundation.org> (raw)
In-Reply-To: <20200102220029.183913184@linuxfoundation.org>
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit f6b8540f40201bff91062dd64db8e29e4ddaaa9d ]
According to SBC-2 a TRANSFER LENGTH field of zero means that 256 logical
blocks must be transferred. Make the SCSI tracing code follow SBC-2.
Fixes: bf8162354233 ("[SCSI] add scsi trace core functions and put trace points")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Link: https://lore.kernel.org/r/20191105215553.185018-1-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_trace.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c
index 0ff083bbf5b1..617a60737590 100644
--- a/drivers/scsi/scsi_trace.c
+++ b/drivers/scsi/scsi_trace.c
@@ -30,15 +30,18 @@ static const char *
scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len)
{
const char *ret = trace_seq_buffer_ptr(p);
- sector_t lba = 0, txlen = 0;
+ u32 lba = 0, txlen;
lba |= ((cdb[1] & 0x1F) << 16);
lba |= (cdb[2] << 8);
lba |= cdb[3];
- txlen = cdb[4];
+ /*
+ * From SBC-2: a TRANSFER LENGTH field set to zero specifies that 256
+ * logical blocks shall be read (READ(6)) or written (WRITE(6)).
+ */
+ txlen = cdb[4] ? cdb[4] : 256;
- trace_seq_printf(p, "lba=%llu txlen=%llu",
- (unsigned long long)lba, (unsigned long long)txlen);
+ trace_seq_printf(p, "lba=%u txlen=%u", lba, txlen);
trace_seq_putc(p, 0);
return ret;
--
2.20.1
next prev parent reply other threads:[~2020-01-02 22:20 UTC|newest]
Thread overview: 134+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-02 22:06 [PATCH 4.19 000/114] 4.19.93-stable review Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 001/114] scsi: lpfc: Fix discovery failures when target device connectivity bounces Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 002/114] scsi: mpt3sas: Fix clear pending bit in ioctl status Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 003/114] scsi: lpfc: Fix locking on mailbox command completion Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 004/114] Input: atmel_mxt_ts - disable IRQ across suspend Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 005/114] f2fs: fix to update time in lazytime mode Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 006/114] iommu: rockchip: Free domain on .domain_free Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 007/114] iommu/tegra-smmu: Fix page tables in > 4 GiB memory Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 008/114] dmaengine: xilinx_dma: Clear desc_pendingcount in xilinx_dma_reset Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 009/114] scsi: target: compare full CHAP_A Algorithm strings Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 010/114] scsi: lpfc: Fix SLI3 hba in loop mode not discovering devices Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 011/114] scsi: csiostor: Dont enable IRQs too early Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 012/114] scsi: hisi_sas: Replace in_softirq() check in hisi_sas_task_exec() Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 013/114] powerpc/pseries: Mark accumulate_stolen_time() as notrace Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 014/114] powerpc/pseries: Dont fail hash page table insert for bolted mapping Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 015/114] powerpc/tools: Dont quote $objdump in scripts Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 016/114] dma-debug: add a schedule point in debug_dma_dump_mappings() Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 017/114] leds: lm3692x: Handle failure to probe the regulator Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 018/114] clocksource/drivers/asm9260: Add a check for of_clk_get Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 019/114] clocksource/drivers/timer-of: Use unique device name instead of timer Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 020/114] powerpc/security/book3s64: Report L1TF status in sysfs Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 021/114] powerpc/book3s64/hash: Add cond_resched to avoid soft lockup warning Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 022/114] ext4: update direct I/O read lock pattern for IOCB_NOWAIT Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 023/114] ext4: iomap that extends beyond EOF should be marked dirty Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 024/114] jbd2: Fix statistics for the number of logged blocks Greg Kroah-Hartman
2020-01-02 22:06 ` Greg Kroah-Hartman [this message]
2020-01-02 22:06 ` [PATCH 4.19 026/114] scsi: lpfc: Fix duplicate unreg_rpi error in port offline flow Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 027/114] f2fs: fix to update dirs i_pino during cross_rename Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 028/114] clk: qcom: Allow constant ratio freq tables for rcg Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 029/114] clk: clk-gpio: propagate rate change to parent Greg Kroah-Hartman
2020-01-03 8:42 ` Pavel Machek
2020-01-02 22:06 ` [PATCH 4.19 030/114] irqchip/irq-bcm7038-l1: Enable parent IRQ if necessary Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 031/114] irqchip: ingenic: Error out if IRQ domain creation failed Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 032/114] mfd: mfd-core: Honour Device Trees request to disable a child-device Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 033/114] fs/quota: handle overflows of sysctl fs.quota.* and report as unsigned long Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 034/114] scsi: lpfc: fix: Coverity: lpfc_cmpl_els_rsp(): Null pointer dereferences Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 035/114] PCI: rpaphp: Fix up pointer to first drc-info entry Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 036/114] scsi: ufs: fix potential bug which ends in system hang Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 037/114] powerpc/pseries/cmm: Implement release() function for sysfs device Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 038/114] PCI: rpaphp: Dont rely on firmware feature to imply drc-info support Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 039/114] PCI: rpaphp: Annotate and correctly byte swap DRC properties Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 040/114] PCI: rpaphp: Correctly match ibm, my-drc-index to drc-name when using drc-info Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 041/114] powerpc/security: Fix wrong message when RFI Flush is disable Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 042/114] scsi: atari_scsi: sun3_scsi: Set sg_tablesize to 1 instead of SG_NONE Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 043/114] clk: pxa: fix one of the pxa RTC clocks Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 044/114] bcache: at least try to shrink 1 node in bch_mca_scan() Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 045/114] HID: quirks: Add quirk for HP MSU1465 PIXART OEM mouse Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 046/114] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors Greg Kroah-Hartman
2020-01-02 22:06 ` [PATCH 4.19 047/114] ARM: 8937/1: spectre-v2: remove Brahma-B53 from hardening Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 048/114] libnvdimm/btt: fix variable rc set but not used Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 049/114] HID: Improve Windows Precision Touchpad detection Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 050/114] HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 051/114] watchdog: Fix the race between the release of watchdog_core_data and cdev Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 052/114] scsi: pm80xx: Fix for SATA device discovery Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 053/114] scsi: ufs: Fix error handing during hibern8 enter Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 054/114] scsi: scsi_debug: num_tgts must be >= 0 Greg Kroah-Hartman
2020-01-03 16:34 ` Pavel Machek
2020-01-02 22:07 ` [PATCH 4.19 055/114] scsi: NCR5380: Add disconnect_mask module parameter Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 056/114] scsi: iscsi: Dont send data to unbound connection Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 057/114] scsi: target: iscsi: Wait for all commands to finish before freeing a session Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 058/114] gpio: mpc8xxx: Dont overwrite default irq_set_type callback Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 059/114] apparmor: fix unsigned len comparison with less than zero Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 060/114] scripts/kallsyms: fix definitely-lost memory leak Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 061/114] powerpc: Dont add -mabi= flags when building with Clang Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 062/114] f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project() Greg Kroah-Hartman
2020-01-03 17:12 ` Pavel Machek
2020-01-04 1:50 ` Chengguang Xu
2020-01-04 11:53 ` Greg Kroah-Hartman
2020-01-04 14:20 ` Chengguang Xu
2020-02-01 9:24 ` Chengguang Xu
2020-02-07 10:19 ` Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 063/114] cdrom: respect device capabilities during opening action Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 064/114] perf script: Fix brstackinsn for AUXTRACE Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 065/114] perf regs: Make perf_reg_name() return "unknown" instead of NULL Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 066/114] s390/zcrypt: handle new reply code FILTERED_BY_HYPERVISOR Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 067/114] libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h Greg Kroah-Hartman
2020-01-03 17:18 ` Pavel Machek
2020-01-02 22:07 ` [PATCH 4.19 068/114] s390/cpum_sf: Check for SDBT and SDB consistency Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 069/114] ocfs2: fix passing zero to PTR_ERR warning Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 070/114] mailbox: imx: Fix Tx doorbell shutdown path Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 071/114] kernel: sysctl: make drop_caches write-only Greg Kroah-Hartman
2020-01-03 18:29 ` Pavel Machek
2020-01-05 15:47 ` Sasha Levin
2020-01-02 22:07 ` [PATCH 4.19 072/114] userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 073/114] Revert "powerpc/vcpu: Assume dedicated processors as non-preempt" Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 074/114] x86/mce: Fix possibly incorrect severity calculation on AMD Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 075/114] net, sysctl: Fix compiler warning when only cBPF is present Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 076/114] netfilter: nf_queue: enqueue skbs with NULL dst Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 077/114] ALSA: hda - Downgrade error message for single-cmd fallback Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 078/114] bonding: fix active-backup transition after link failure Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 079/114] perf strbuf: Remove redundant va_end() in strbuf_addv() Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 080/114] Make filldir[64]() verify the directory entry filename is valid Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 081/114] filldir[64]: remove WARN_ON_ONCE() for bad directory entries Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 082/114] PCI/switchtec: Read all 64 bits of part_event_bitmap Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 083/114] netfilter: ebtables: compat: reject all padding in matches/watchers Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 084/114] 6pack,mkiss: fix possible deadlock Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 085/114] netfilter: bridge: make sure to pull arp header in br_nf_forward_arp() Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 086/114] inetpeer: fix data-race in inet_putpeer / inet_putpeer Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 087/114] net: add a READ_ONCE() in skb_peek_tail() Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 088/114] net: icmp: fix data-race in cmp_global_allow() Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 089/114] hrtimer: Annotate lockless access to timer->state Greg Kroah-Hartman
2020-01-03 19:07 ` Pavel Machek
2020-01-02 22:07 ` [PATCH 4.19 090/114] net: ena: fix napi handler misbehavior when the napi budget is zero Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 091/114] net/mlxfw: Fix out-of-memory error in mfa2 flash burning Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 092/114] net: stmmac: dwmac-meson8b: Fix the RGMII TX delay on Meson8b/8m2 SoCs Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 093/114] ptp: fix the race between the release of ptp_clock and cdev Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 094/114] tcp: Fix highest_sack and highest_sack_seq Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 095/114] udp: fix integer overflow while computing available space in sk_rcvbuf Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 096/114] vhost/vsock: accept only packets with the right dst_cid Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 097/114] net: add bool confirm_neigh parameter for dst_ops.update_pmtu Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 098/114] ip6_gre: do not confirm neighbor when do pmtu update Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 099/114] gtp: " Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 100/114] net/dst: add new function skb_dst_update_pmtu_no_confirm Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 101/114] tunnel: do not confirm neighbor when do pmtu update Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 102/114] vti: " Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 103/114] sit: " Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 104/114] net/dst: do not confirm neighbor for vxlan and geneve " Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 105/114] gtp: do not allow adding duplicate tid and ms_addr pdp context Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 106/114] net: marvell: mvpp2: phylink requires the link interrupt Greg Kroah-Hartman
2020-01-02 22:07 ` [PATCH 4.19 107/114] tcp/dccp: fix possible race __inet_lookup_established() Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 108/114] tcp: do not send empty skb from tcp_write_xmit() Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 109/114] gtp: fix wrong condition in gtp_genl_dump_pdp() Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 110/114] gtp: fix an use-after-free in ipv4_pdp_find() Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 111/114] gtp: avoid zero size hashtable Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 112/114] spi: fsl: dont map irq during probe Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 113/114] tty/serial: atmel: fix out of range clock divider handling Greg Kroah-Hartman
2020-01-02 22:08 ` [PATCH 4.19 114/114] pinctrl: baytrail: Really serialize all register accesses Greg Kroah-Hartman
2020-01-03 14:27 ` [PATCH 4.19 000/114] 4.19.93-stable review Guenter Roeck
2020-01-03 15:41 ` Greg Kroah-Hartman
2020-01-03 17:46 ` Guenter Roeck
2020-01-04 12:32 ` Greg Kroah-Hartman
2020-01-04 4:32 ` Naresh Kamboju
2020-01-03 17:51 ` Jon Hunter
2020-01-03 21:55 ` shuah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200102220031.656066896@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bvanassche@acm.org \
--cc=dgilbert@interlog.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox