linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Gurney <bgurney@redhat.com>
To: Jorge Fernandez Monteagudo <jorgefm@cirsa.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	"tj@kernel.org" <tj@kernel.org>,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: SATA errors accessing hidden partitions
Date: Tue, 10 Sep 2019 11:12:36 -0400	[thread overview]
Message-ID: <CAHhmqcTF1wBq037v2dDrKOs8tNhAMzw4_nY_52KY65NvCqWDXw@mail.gmail.com> (raw)
In-Reply-To: <AM6PR10MB3399036D93B32666191730D1A1B60@AM6PR10MB3399.EURPRD10.PROD.OUTLOOK.COM>

On Tue, Sep 10, 2019 at 10:03 AM Jorge Fernandez Monteagudo
<jorgefm@cirsa.com> wrote:
>
> Hi Bryan! Thanks for your detailed answer!
>
> >Notice that logical block 524272 on devices sda3, sda4, and sda5 are
> >cited.  This is a blind guess, but are these partitions 524288 sectors
> >(256 MB) in size?
>
> No, they're 4GB partitions.
>

Oh, okay.  I'm pretty sure that blkid checks regions near the end of a
device (for example, GPT has what looks like a backup of the "EFI
PART" boot record near the end of the device).  Therefore, it may be
worthwhile to double-check the size of the partition, in case they're
not 4 GB, for some strange reason.

> >You can notice that the first few reads are near the "end" of the
> >partition.  In fact, the first two read completions are 128 sectors
> >before the end, and 16 sectors before the end.  I'm guessing that this
> >"-16" read is the one that's failing in these three partitions.
>
> Then, there is an inconsistency in the blkid and kernel communication? Why the kernel
> tries to access to a locked range? It seems that blkid ask for a sector and the kernel try
> to read it back ignoring its locked, reducing speed and trying again with no luck until
> the error is returned. This is consistent with our workaround removing blkid from the
> udev rule to avoid the error.
>
> Maybe the OPAL is not clear enough about locked ranges and kernel thinks is an error,
> or it's an error in the disk's firmware I don't know, but under windows or MacOS X no
> error is displayed.
>
> Is there some way to ask a disk for their locked ranges and patch blkid to avoid accesing them?
>

I don't know about that, but keep in mind that other programs can use
libblkid to check devices for metadata, so implementing the udev rule
may not be enough.

Here's an excerpt of the dmesg lines from the first error:

[    7.740876] ata1.00: exception Emask 0x0 SAct 0x70000083 SErr 0x0 action 0x0
[    7.740914] ata1.00: irq_stat 0x40000008
[    7.740930] ata1.00: failed command: READ FPDMA QUEUED
[    7.740951] ata1.00: cmd 60/08:00:80:27:43/00:00:03:00:00/40 tag 0
ncq dma 4096 in
                        res 41/04:00:80:27:43/00:00:03:00:00/00 Emask
0x401 (device error) <F>
[    7.741003] ata1.00: status: { DRDY ERR }
[    7.741017] ata1.00: error: { ABRT }
[    7.741154] ata1.00: supports DRM functions and may not be fully accessible
[    7.741713] ata1.00: supports DRM functions and may not be fully accessible
[    7.742121] ata1.00: configured for UDMA/133
[    7.742139] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE
[    7.742141] sd 0:0:0:0: [sda] tag#0 Sense Key : Illegal Request [current]
[    7.742144] sd 0:0:0:0: [sda] tag#0 Add. Sense: Unaligned write command
[    7.742147] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 03 43 27 80
00 00 08 00
[    7.742149] print_req_error: I/O error, dev sda, sector 54732672
[    7.742201] ata1: EH complete

Why is there an "Illegal Request - Unaligned write command" sense
error from sd, right after the failed ata command "READ FPDMA QUEUED"?
 Is this an expected failure mode for a read to a locked range?  (I'm
not familiar with TCG Opal drives, so unfortunately I don't have
enough context.)


Thanks,

Bryan

  reply	other threads:[~2019-09-10 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AM6PR10MB33991CE19828429C676C0296A1C40@AM6PR10MB3399.EURPRD10.PROD.OUTLOOK.COM>
2019-09-09  6:25 ` SATA errors accessing hidden partitions Jorge Fernandez Monteagudo
2019-09-10  5:53   ` Christoph Hellwig
2019-09-10  8:03     ` Jorge Fernandez Monteagudo
2019-09-10 11:40       ` Christoph Hellwig
2019-09-10 13:08       ` Bryan Gurney
2019-09-10 14:03         ` Jorge Fernandez Monteagudo
2019-09-10 15:12           ` Bryan Gurney [this message]
2019-09-11  6:34             ` Christoph Hellwig

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=CAHhmqcTF1wBq037v2dDrKOs8tNhAMzw4_nY_52KY65NvCqWDXw@mail.gmail.com \
    --to=bgurney@redhat.com \
    --cc=hch@infradead.org \
    --cc=jorgefm@cirsa.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).