All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: David Howells <dhowells@redhat.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: SCSI error indicating misalignment on part of Linux scsi or block layer?
Date: Wed, 17 Jul 2024 08:07:18 +0900	[thread overview]
Message-ID: <b69d54af-2ac2-406a-ab32-9bad9d8a3000@kernel.org> (raw)
In-Reply-To: <483247.1721159741@warthog.procyon.org.uk>

On 7/17/24 04:55, David Howells wrote:
> Hi James,
> 
> I'm wondering if I'm seeing a problem with DIO writes through Ext4 or XFS
> manifesting as SCSI misalignment errors.  This has occurred with two different
> drives.  I saw it first with v6.10-rc6, I think, but I haven't tried
> cachefiles for a while.  It does happen with v6.10.
> 
> ata1.00: exception Emask 0x60 SAct 0x1 SErr 0x800 action 0x6 frozen
> ata1.00: irq_stat 0x20000000, host bus error

Bus error is a serious error...

> ata1: SError: { HostInt }
> ata1.00: failed command: WRITE FPDMA QUEUED
> ata1.00: cmd 61/68:00:b0:93:34/00:00:02:00:00/40 tag 0 ncq dma 53248 out
>          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x60 (host bus error)
> ata1.00: status: { DRDY }
> ata1: hard resetting link
> ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

That is very low... Old hardware ?

> ata1.00: configured for UDMA/133
> sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
> sd 0:0:0:0: [sda] tag#0 Sense Key : Illegal Request [current] 
> sd 0:0:0:0: [sda] tag#0 Add. Sense: Unaligned write command

That is likely the result of the automatice generation of sense data for failed
commands based on ata status and error fields for a failed command, which
defaults to this when nothing else matches (yeah, I know, that is not pretty.
But the SAT specs in that area are a nightmare and following them actually ends
up with this asc/ascq. Will try to do something about it).

The host bus error is the issue. Not sure what triggers it though.
What is the adapter model you are using ?

> sd 0:0:0:0: [sda] tag#0 CDB: Write(10) 2a 00 02 34 93 b0 00 00 68 00
> I/O error, dev sda, sector 37000112 op 0x1:(WRITE) flags 0x8800 phys_seg 1 prio class 0
> ata1: EH complete
> 
> For reference, I made it dump the result of the READ CAPACITY 16 command:
> 
> sd 0:0:0:0: [sda] RC16 000000003a38602f000002000000000000000000000000000000000000000000
> 
> The drive says it has 512-byte logical and physical block sizes.
> 
> The DIO writes are being generated by cachefiles and are all
> PAGE_SIZED-aligned in terms of file offset and request length.
> 
> I also saw this:
> 
> 	CacheFiles: I/O Error: Trunc-to-dio-size failed -95 [o=000001cb]
> 
> which indicates that ext4/xfs returned EOPNOTSUPP to vfs_truncate() and thence
> to cachefiles.  I'm not sure why it would do that.
> 
> Any idea what might cause this or how to investigate it further?  Is it
> possible it's some sort of hardware error in the I/O bridge or IOMMU?
> 
> Thanks,
> David
> 
> 

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-07-16 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 19:55 SCSI error indicating misalignment on part of Linux scsi or block layer? David Howells
2024-07-16 23:07 ` Damien Le Moal [this message]
2024-07-17  0:01   ` David Howells
2024-07-17  0:31     ` Damien Le Moal

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=b69d54af-2ac2-406a-ab32-9bad9d8a3000@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dhowells@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.