Linux-ide Archive on lore.kernel.org
 help / color / 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 09:08:14 -0400
Message-ID: <CAHhmqcSGK2W0Gz9CM=cKYH6PjtGnOwnWtadG7qOwYmQLjGwNAQ@mail.gmail.com> (raw)
In-Reply-To: <AM6PR10MB339977CEF9AB4C3726AF3124A1B60@AM6PR10MB3399.EURPRD10.PROD.OUTLOOK.COM>

On Tue, Sep 10, 2019 at 4:03 AM Jorge Fernandez Monteagudo
<jorgefm@cirsa.com> wrote:
>
> >> Hi all,
> >>
> >> I have a SSD disk from transcend with 6 partitions, where partitions 3, 4 and 5 are locked. This disk implements the OPAL specifications and transcend supplies some tools to hide/unhide a partition.
> >
> >OPAL does not have a concept to hide a partition, it supports locking
> >ranges.  In doubt you want to use the kernel opal support to unlock all
> >ranges and should be fine, otherwise there isn't too much we can do.
>
> You're right. We are  using locking ranges and these partitions are mapped onto these ranges.
> We're try too with a locked range without any partition inside an the system tries to access the
> locked range. We're wondering why kernel? blkid? is trying to get info from a locked range??
> The outcome is a SATA link in 1.5Gbps after a long time boot. In windows or MacOSx works in
> other way.
>
> Thanks!
> Jorge

Here's a quick grep of the dmesg you sent earlier (apologies if
there's any line wrapping):

$ egrep 'blocks|Buffer|print_req_error|Gbps'
20190910_linux-ide-jfernandez_deb_syserror_opaldrive.txt
[    1.506617] ahci 0000:00:11.0: AHCI 0001.0300 32 slots 2 ports 6
Gbps 0x3 impl SATA mode
[    1.984614] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    1.988604] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    7.664613] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    7.694638] sd 0:0:0:0: [sda] 62533296 512-byte logical blocks:
(32.0 GB/29.8 GiB)
[    7.694674] sd 1:0:0:0: [sdb] 125045424 512-byte logical blocks:
(64.0 GB/59.6 GiB)
[    7.742149] print_req_error: I/O error, dev sda, sector 54732672
[    7.774167] print_req_error: I/O error, dev sda, sector 46344064
[    7.841977] print_req_error: I/O error, dev sda, sector 50538368
[    7.964634] ata1: limiting SATA link speed to 3.0 Gbps
[    8.444612] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[    8.584387] print_req_error: I/O error, dev sda, sector 46344064
[    8.585346] Buffer I/O error on dev sda3, logical block 524272,
async page read
[    8.624635] ata1: limiting SATA link speed to 1.5 Gbps
[    9.104613] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[    9.152565] print_req_error: I/O error, dev sda, sector 54732672
[    9.153517] Buffer I/O error on dev sda5, logical block 524272,
async page read
[    9.184662] print_req_error: I/O error, dev sda, sector 50538368
[    9.185625] Buffer I/O error on dev sda4, logical block 524272,
async page read
[   10.545916] print_req_error: I/O error, dev sda, sector 46344064
[   10.595852] print_req_error: I/O error, dev sda, sector 54732672
[   10.666024] print_req_error: I/O error, dev sda, sector 50538368
[   11.197218] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[   11.694090] print_req_error: I/O error, dev sda, sector 46344064
[   11.694098] Buffer I/O error on dev sda3, logical block 524272,
async page read
[   11.721959] Buffer I/O error on dev sda4, logical block 524272,
async page read
[   11.750000] Buffer I/O error on dev sda5, logical block 524272,
async page read

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?

When blkid reads a device or a partition, there's a certain sequence
of reads that it performs, at various offsets in the device.  Via
blktrace / blkparse, you can see this activity.

For an example device with a partition that starts at sector 2048, and
ends at sector 3019900928:
# blktrace -d /dev/nvme0n1p1
(Ctrl+C)
...
# blkparse -i nvme0n1p1.blktrace.0 | grep C\ *
259,1    9        7     0.000096020     0  C   R 3019900800 + 8 [0]
259,1    9       14     0.000193530     0  C   R 3019900912 + 8 [0]
259,1    9       21     0.000260749     0  C   R 2048 + 8 [0]
259,1    9       28     0.000327329     0  C   R 2056 + 8 [0]
259,1    9       35     0.000416985     0  C   R 3019900920 + 8 [0]
259,1    9       42     0.000516949     0  C   R 3019900664 + 8 [0]
259,1    9       49     0.000662515     0  C   R 2080 + 8 [0]
259,1    9       56     0.000755225     0  C   R 2112 + 8 [0]
259,1    9       63     0.000845546     0  C   R 2176 + 8 [0]
259,1    9       70     0.000936905     0  C   R 2304 + 8 [0]

...and so on.  (The device major,minor says "259,1", which would be
/dev/nvme0n1p1, but the offset shown in the block trace is relative to
/dev/nvme0n1.)

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.


Thanks,

Bryan

  parent reply index

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 ` 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 [this message]
2019-09-10 14:03         ` Jorge Fernandez Monteagudo
2019-09-10 15:12           ` Bryan Gurney
2019-09-11  6:34             ` Christoph Hellwig

Reply instructions:

You may reply publically 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='CAHhmqcSGK2W0Gz9CM=cKYH6PjtGnOwnWtadG7qOwYmQLjGwNAQ@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

Linux-ide Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ide/0 linux-ide/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ide linux-ide/ https://lore.kernel.org/linux-ide \
		linux-ide@vger.kernel.org linux-ide@archiver.kernel.org
	public-inbox-index linux-ide


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ide


AGPL code for this site: git clone https://public-inbox.org/ public-inbox