All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: blkdiscard BLKDISCARD ioctl failed: Remote I/O error
       [not found]   ` <CAJWTG8-yrpLevVALX9ONnQGEgFcytYuhSk4ge_-qyi0tQS0keg@mail.gmail.com>
@ 2022-02-21 13:09     ` Lukas Czerner
       [not found]       ` <CAJWTG89zxt3H41kaVjq9kSx=XSBwq=EpO9+1THydwG_-Xc6-ZQ@mail.gmail.com>
  2022-02-21 14:45       ` Ming Lei
  0 siblings, 2 replies; 5+ messages in thread
From: Lukas Czerner @ 2022-02-21 13:09 UTC (permalink / raw)
  To: Olaf Fraczyk; +Cc: Karel Zak, linux-block

Hi,

the problem is definitelly not in util-linux. In kernel there are checks
in place that would prevent proceeding with out of range BLKDISCARD ioctl,
but that's not what we hit here.

In the logs below you can see that the actual discard request failed,
but it appears to be well within the device range. I don't know what is
going on, maybe someone in the linux-block have a clue (adding to cc).

Meanwhile please let us know what kernel version do you have and provide
a blkparse output of the blkdiscard run. You can do this for example

blktrace -a discard -d /dev/sdb -o - | \
blkparse -o output -f "%D %2c %8s %5T.%9t %6p %2a %3d %10S + %10U (%4e) [%C]\n" -i -

then run the blkdiscard and see the content of output file.

Thanks!
-Lukas



On Mon, Feb 21, 2022 at 01:34:57PM +0100, Olaf Fraczyk wrote:
> Hello,
> 
> I had to put the disk in use, and I needed it in MBR format, so I can't
> create GPT now.
> 
> Anyway, the reported size seems to be OK.
> 
> I have created 3rd partition to go till the end of the disk, as below:
> 
> Device     Boot      Start        End    Sectors   Size Id Type
> /dev/sdb1             2048    4196351    4194304     2G fd Linux raid
> autodetect
> /dev/sdb2          4196352 1874855935 1870659584   892G fd Linux raid
> autodetect
> /dev/sdb3       1874855936 1875385007     529072 258.3M 83 Linux
> 
> I can fill it to the last sector using dd without problems:
> 
> [root@vh3 ~]# dd if=/dev/zero of=/dev/sdb3 bs=1024 count=264536
> 264536+0 records in
> 264536+0 records out
> 270884864 bytes (271 MB, 258 MiB) copied, 4.81622 s, 56.2 MB/s
> 
> When I do blkdiscard:
> 
> root@vh3 ~]# blkdiscard -l 264536K /dev/sdb3
> blkdiscard: /dev/sdb3: BLKDISCARD ioctl failed: Remote I/O error
> [root@vh3 ~]# blkdiscard -l 264535K /dev/sdb3
> [root@vh3 ~]#
> 
> In the /var/log/messages for the failed discard I get:
> Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 FAILED Result:
> hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
> Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Sense Key : Illegal
> Request [current]
> Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Add. Sense: Logical
> block address out of range
> Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 CDB: Unmap/Read
> sub-channel 42 00 00 00 00 00 00 00 18 00
> Feb 21 13:19:52 vh3 kernel: blk_update_request: critical target error, dev
> sdb, sector 1874855936 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 0
> 
> I have the drive on a SAS controller - mpt3sas driver, LSI SAS2008
> 
> Best regards,
> 
> Olaf
> 
> 
> 
> 
> 
> pon., 21 lut 2022 o 10:06 Karel Zak <kzak@redhat.com> napisał(a):
> 
> >
> >  Hi Olaf,
> >
> >  from my point of view it seems like kernel (SSD driver) issue. The
> >  ioctl needs to accept range from 0 to device size. The another
> >  possibility is that the device itself reports incorrect size. Do you
> >  see another issue, for example when you try to create GPT partition
> >  table on the device, or so? Do you see anything in dmesg output?
> >
> >  CC: Lukas Czerner who understands kernel part :-)
> >
> >     Karel
> >
> >
> > On Thu, Feb 17, 2022 at 10:32:06PM +0100, Olaf Fraczyk wrote:
> > > Hello,
> > >
> > > Tried:
> > > util-linux-2.32.1-28.el8.x86_64 (Almalinux 8)
> > > util-linux-2.38-rc1 (compiled from sources)
> > >
> > > I have a problem with blkdiscard and Samsung  PM893 SSD 960GB drive.
> > >
> > > I tried to trim entire drive but I get the following error:
> > > [root@vh3 util-linux-2.38-rc1]# ./blkdiscard /dev/sdb
> > > lt-blkdiscard: /dev/sdb: BLKDISCARD ioctl failed: Remote I/O error
> > >
> > > I have done strace and I see:
> > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > ioctl(3, BLKSSZGET, [512])              = 0
> > > ioctl(3, BLKDISCARD, [0, 960197124096]) = -1 EREMOTEIO (Remote I/O error)
> > >
> > > When I do the same giving length explicitly I get the same error.
> > >
> > > However when I specify the length 512 bytes smaller, it works without a
> > > problem:
> > >
> > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > ioctl(3, BLKSSZGET, [512])              = 0
> > > ioctl(3, BLKDISCARD, [0, 960197123584]) = 0
> > >
> > > Disk size from fdisk:
> > > [root@vh3 util-linux-2.38-rc1]# fdisk -l /dev/sdb
> > > Disk /dev/sdb: 894.3 GiB, 960197124096 bytes, 1875385008 sectors
> > > Units: sectors of 1 * 512 = 512 bytes
> > > Sector size (logical/physical): 512 bytes / 4096 bytes
> > > I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> > >
> > >
> > > Is this a problem with the SSD drive or with the blkdiscard command /
> > ioctl?
> > > Could you please help me solve this issue?
> > >
> > > Best regards,
> > >
> > > Olaf Frączyk
> >
> > --
> >  Karel Zak  <kzak@redhat.com>
> >  http://karelzak.blogspot.com
> >
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: blkdiscard BLKDISCARD ioctl failed: Remote I/O error
       [not found]       ` <CAJWTG89zxt3H41kaVjq9kSx=XSBwq=EpO9+1THydwG_-Xc6-ZQ@mail.gmail.com>
@ 2022-02-21 13:47         ` Lukas Czerner
  0 siblings, 0 replies; 5+ messages in thread
From: Lukas Czerner @ 2022-02-21 13:47 UTC (permalink / raw)
  To: Olaf Fraczyk; +Cc: Karel Zak, linux-block

On Mon, Feb 21, 2022 at 02:38:02PM +0100, Olaf Fraczyk wrote:
>  Kernel:
> Linux version 4.18.0-348.12.2.el8_5.x86_64 (
> mockbuild@koji.corp.cloudlinux.com) (gcc version 8.5.0 20210514 (Red Hat
> 8.5.0-4) (GCC)) #1 SMP Wed Jan 19 14:35:04 EST 2022

Ah, I didn't know this is RHEL. You should contact you support
representative who can walk you through creating an issue tracker for
this problem so that we can help you resolve this.

Or if you don't have one at least create a RH bugzilla for this.

Thanks!
-Lukas

> 
> Here is what I got:
> [root@vh3 blk]# cat output
>   8,16   1        1     0.000000000 416746  A  DS 1874855936 +    8388624 (
>   0) [blkdiscard]
>   8,16   1        2     0.000005308 416746  Q  DS 1874855936 + 1701733231 (
>   0) [blkdiscard]
>   8,16   1        3     0.000013479 416746  G  DS 1874855936 + 1952807028 (
>   0) [blkdiscard]
>   8,16   1        4     0.000015854 416746  I  DS 1874855936 +  875639306 (
>   0) [blkdiscard]
>   8,16   1        5     0.000029054    312  D  DS 1874855936 +  943207737 (
>   0) [kworker/1:1H]
>   8,16   1        6     0.000100222      0  C  DS 1874855936 + 1397697848 (
>   0) [swapper/1]
>   8,16   1        7     0.000109791      0  C  DS 1874855936 +  157966687
> (65415) [swapper/1]
> CPU1 (8,16):
>  Reads Queued:           0,        0KiB Writes Queued:           1,
>  264,536KiB
>  Read Dispatches:        0,        0KiB Write Dispatches:        1,
>  264,536KiB
>  Reads Requeued:         0 Writes Requeued:         0
>  Reads Completed:        0,        0KiB Writes Completed:        2,
>  264,536KiB
>  Read Merges:            0,        0KiB Write Merges:            0,
>  0KiB
>  Read depth:             0         Write depth:             1
>  IO unplugs:             0         Timer unplugs:           0
> 
> Throughput (R/W): 0KiB/s / 0KiB/s
> Events (8,16): 7 entries
> Skips: 0 forward (0 -   0.0%)
> 
> Olaf
> 
> pon., 21 lut 2022 o 14:09 Lukas Czerner <lczerner@redhat.com> napisał(a):
> 
> > Hi,
> >
> > the problem is definitelly not in util-linux. In kernel there are checks
> > in place that would prevent proceeding with out of range BLKDISCARD ioctl,
> > but that's not what we hit here.
> >
> > In the logs below you can see that the actual discard request failed,
> > but it appears to be well within the device range. I don't know what is
> > going on, maybe someone in the linux-block have a clue (adding to cc).
> >
> > Meanwhile please let us know what kernel version do you have and provide
> > a blkparse output of the blkdiscard run. You can do this for example
> >
> > blktrace -a discard -d /dev/sdb -o - | \
> > blkparse -o output -f "%D %2c %8s %5T.%9t %6p %2a %3d %10S + %10U (%4e)
> > [%C]\n" -i -
> >
> > then run the blkdiscard and see the content of output file.
> >
> > Thanks!
> > -Lukas
> >
> >
> >
> > On Mon, Feb 21, 2022 at 01:34:57PM +0100, Olaf Fraczyk wrote:
> > > Hello,
> > >
> > > I had to put the disk in use, and I needed it in MBR format, so I can't
> > > create GPT now.
> > >
> > > Anyway, the reported size seems to be OK.
> > >
> > > I have created 3rd partition to go till the end of the disk, as below:
> > >
> > > Device     Boot      Start        End    Sectors   Size Id Type
> > > /dev/sdb1             2048    4196351    4194304     2G fd Linux raid
> > > autodetect
> > > /dev/sdb2          4196352 1874855935 1870659584   892G fd Linux raid
> > > autodetect
> > > /dev/sdb3       1874855936 1875385007     529072 258.3M 83 Linux
> > >
> > > I can fill it to the last sector using dd without problems:
> > >
> > > [root@vh3 ~]# dd if=/dev/zero of=/dev/sdb3 bs=1024 count=264536
> > > 264536+0 records in
> > > 264536+0 records out
> > > 270884864 bytes (271 MB, 258 MiB) copied, 4.81622 s, 56.2 MB/s
> > >
> > > When I do blkdiscard:
> > >
> > > root@vh3 ~]# blkdiscard -l 264536K /dev/sdb3
> > > blkdiscard: /dev/sdb3: BLKDISCARD ioctl failed: Remote I/O error
> > > [root@vh3 ~]# blkdiscard -l 264535K /dev/sdb3
> > > [root@vh3 ~]#
> > >
> > > In the /var/log/messages for the failed discard I get:
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 FAILED Result:
> > > hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Sense Key :
> > Illegal
> > > Request [current]
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Add. Sense:
> > Logical
> > > block address out of range
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 CDB: Unmap/Read
> > > sub-channel 42 00 00 00 00 00 00 00 18 00
> > > Feb 21 13:19:52 vh3 kernel: blk_update_request: critical target error,
> > dev
> > > sdb, sector 1874855936 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio
> > class 0
> > >
> > > I have the drive on a SAS controller - mpt3sas driver, LSI SAS2008
> > >
> > > Best regards,
> > >
> > > Olaf
> > >
> > >
> > >
> > >
> > >
> > > pon., 21 lut 2022 o 10:06 Karel Zak <kzak@redhat.com> napisał(a):
> > >
> > > >
> > > >  Hi Olaf,
> > > >
> > > >  from my point of view it seems like kernel (SSD driver) issue. The
> > > >  ioctl needs to accept range from 0 to device size. The another
> > > >  possibility is that the device itself reports incorrect size. Do you
> > > >  see another issue, for example when you try to create GPT partition
> > > >  table on the device, or so? Do you see anything in dmesg output?
> > > >
> > > >  CC: Lukas Czerner who understands kernel part :-)
> > > >
> > > >     Karel
> > > >
> > > >
> > > > On Thu, Feb 17, 2022 at 10:32:06PM +0100, Olaf Fraczyk wrote:
> > > > > Hello,
> > > > >
> > > > > Tried:
> > > > > util-linux-2.32.1-28.el8.x86_64 (Almalinux 8)
> > > > > util-linux-2.38-rc1 (compiled from sources)
> > > > >
> > > > > I have a problem with blkdiscard and Samsung  PM893 SSD 960GB drive.
> > > > >
> > > > > I tried to trim entire drive but I get the following error:
> > > > > [root@vh3 util-linux-2.38-rc1]# ./blkdiscard /dev/sdb
> > > > > lt-blkdiscard: /dev/sdb: BLKDISCARD ioctl failed: Remote I/O error
> > > > >
> > > > > I have done strace and I see:
> > > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > > ioctl(3, BLKDISCARD, [0, 960197124096]) = -1 EREMOTEIO (Remote I/O
> > error)
> > > > >
> > > > > When I do the same giving length explicitly I get the same error.
> > > > >
> > > > > However when I specify the length 512 bytes smaller, it works
> > without a
> > > > > problem:
> > > > >
> > > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > > ioctl(3, BLKDISCARD, [0, 960197123584]) = 0
> > > > >
> > > > > Disk size from fdisk:
> > > > > [root@vh3 util-linux-2.38-rc1]# fdisk -l /dev/sdb
> > > > > Disk /dev/sdb: 894.3 GiB, 960197124096 bytes, 1875385008 sectors
> > > > > Units: sectors of 1 * 512 = 512 bytes
> > > > > Sector size (logical/physical): 512 bytes / 4096 bytes
> > > > > I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> > > > >
> > > > >
> > > > > Is this a problem with the SSD drive or with the blkdiscard command /
> > > > ioctl?
> > > > > Could you please help me solve this issue?
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Olaf Frączyk
> > > >
> > > > --
> > > >  Karel Zak  <kzak@redhat.com>
> > > >  http://karelzak.blogspot.com
> > > >
> > > >
> >
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: blkdiscard BLKDISCARD ioctl failed: Remote I/O error
  2022-02-21 13:09     ` blkdiscard BLKDISCARD ioctl failed: Remote I/O error Lukas Czerner
       [not found]       ` <CAJWTG89zxt3H41kaVjq9kSx=XSBwq=EpO9+1THydwG_-Xc6-ZQ@mail.gmail.com>
@ 2022-02-21 14:45       ` Ming Lei
  2022-02-21 15:50         ` Olaf Fraczyk
       [not found]         ` <CAJWTG8_2bgioHW87VntCvhCOA8_B8GMsuk+82o7uuHPx=9yt1w@mail.gmail.com>
  1 sibling, 2 replies; 5+ messages in thread
From: Ming Lei @ 2022-02-21 14:45 UTC (permalink / raw)
  To: Lukas Czerner, linux-scsi, MPT-FusionLinux.pdl,
	Martin K. Petersen, Sathya Prakash
  Cc: Olaf Fraczyk, Karel Zak, linux-block

On Mon, Feb 21, 2022 at 02:09:12PM +0100, Lukas Czerner wrote:
> Hi,
> 
> the problem is definitelly not in util-linux. In kernel there are checks
> in place that would prevent proceeding with out of range BLKDISCARD ioctl,
> but that's not what we hit here.
> 
> In the logs below you can see that the actual discard request failed,
> but it appears to be well within the device range. I don't know what is
> going on, maybe someone in the linux-block have a clue (adding to cc).
> 
> Meanwhile please let us know what kernel version do you have and provide
> a blkparse output of the blkdiscard run. You can do this for example
> 
> blktrace -a discard -d /dev/sdb -o - | \
> blkparse -o output -f "%D %2c %8s %5T.%9t %6p %2a %3d %10S + %10U (%4e) [%C]\n" -i -
> 
> then run the blkdiscard and see the content of output file.
> 
> Thanks!
> -Lukas
> 
> 
> 
> On Mon, Feb 21, 2022 at 01:34:57PM +0100, Olaf Fraczyk wrote:
> > Hello,
> > 
> > I had to put the disk in use, and I needed it in MBR format, so I can't
> > create GPT now.
> > 
> > Anyway, the reported size seems to be OK.
> > 
> > I have created 3rd partition to go till the end of the disk, as below:
> > 
> > Device     Boot      Start        End    Sectors   Size Id Type
> > /dev/sdb1             2048    4196351    4194304     2G fd Linux raid
> > autodetect
> > /dev/sdb2          4196352 1874855935 1870659584   892G fd Linux raid
> > autodetect
> > /dev/sdb3       1874855936 1875385007     529072 258.3M 83 Linux
> > 
> > I can fill it to the last sector using dd without problems:
> > 
> > [root@vh3 ~]# dd if=/dev/zero of=/dev/sdb3 bs=1024 count=264536
> > 264536+0 records in
> > 264536+0 records out
> > 270884864 bytes (271 MB, 258 MiB) copied, 4.81622 s, 56.2 MB/s
> > 
> > When I do blkdiscard:
> > 
> > root@vh3 ~]# blkdiscard -l 264536K /dev/sdb3
> > blkdiscard: /dev/sdb3: BLKDISCARD ioctl failed: Remote I/O error
> > [root@vh3 ~]# blkdiscard -l 264535K /dev/sdb3
> > [root@vh3 ~]#
> > 
> > In the /var/log/messages for the failed discard I get:
> > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 FAILED Result:
> > hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
> > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Sense Key : Illegal
> > Request [current]
> > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Add. Sense: Logical
> > block address out of range
> > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 CDB: Unmap/Read
> > sub-channel 42 00 00 00 00 00 00 00 18 00
> > Feb 21 13:19:52 vh3 kernel: blk_update_request: critical target error, dev
> > sdb, sector 1874855936 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 0
> > 
> > I have the drive on a SAS controller - mpt3sas driver, LSI SAS2008

Looks one target issue, CC linux-scsi and mpt3sas guys.

> > > >
> > > > I tried to trim entire drive but I get the following error:
> > > > [root@vh3 util-linux-2.38-rc1]# ./blkdiscard /dev/sdb
> > > > lt-blkdiscard: /dev/sdb: BLKDISCARD ioctl failed: Remote I/O error
> > > >
> > > > I have done strace and I see:
> > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > ioctl(3, BLKDISCARD, [0, 960197124096]) = -1 EREMOTEIO (Remote I/O error)
> > > >
> > > > When I do the same giving length explicitly I get the same error.
> > > >
> > > > However when I specify the length 512 bytes smaller, it works without a
> > > > problem:
> > > >
> > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > ioctl(3, BLKDISCARD, [0, 960197123584]) = 0


Thanks,
Ming


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: blkdiscard BLKDISCARD ioctl failed: Remote I/O error
  2022-02-21 14:45       ` Ming Lei
@ 2022-02-21 15:50         ` Olaf Fraczyk
       [not found]         ` <CAJWTG8_2bgioHW87VntCvhCOA8_B8GMsuk+82o7uuHPx=9yt1w@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Olaf Fraczyk @ 2022-02-21 15:50 UTC (permalink / raw)
  Cc: linux-scsi, linux-block

Hi Ming,

You are right.
I moved the drive to onboard SATA controller and the problem disappeared.

As mpt3sas driver is from ELRepo (RedHat dropped support for this
controller in RHEL 8.x) I don't know if I should continue it here or
contact somebody from ELRepo?

Regards,
Olaf


pon., 21 lut 2022 o 15:45 Ming Lei <ming.lei@redhat.com> napisał(a):
>
> On Mon, Feb 21, 2022 at 02:09:12PM +0100, Lukas Czerner wrote:
> > Hi,
> >
> > the problem is definitelly not in util-linux. In kernel there are checks
> > in place that would prevent proceeding with out of range BLKDISCARD ioctl,
> > but that's not what we hit here.
> >
> > In the logs below you can see that the actual discard request failed,
> > but it appears to be well within the device range. I don't know what is
> > going on, maybe someone in the linux-block have a clue (adding to cc).
> >
> > Meanwhile please let us know what kernel version do you have and provide
> > a blkparse output of the blkdiscard run. You can do this for example
> >
> > blktrace -a discard -d /dev/sdb -o - | \
> > blkparse -o output -f "%D %2c %8s %5T.%9t %6p %2a %3d %10S + %10U (%4e) [%C]\n" -i -
> >
> > then run the blkdiscard and see the content of output file.
> >
> > Thanks!
> > -Lukas
> >
> >
> >
> > On Mon, Feb 21, 2022 at 01:34:57PM +0100, Olaf Fraczyk wrote:
> > > Hello,
> > >
> > > I had to put the disk in use, and I needed it in MBR format, so I can't
> > > create GPT now.
> > >
> > > Anyway, the reported size seems to be OK.
> > >
> > > I have created 3rd partition to go till the end of the disk, as below:
> > >
> > > Device     Boot      Start        End    Sectors   Size Id Type
> > > /dev/sdb1             2048    4196351    4194304     2G fd Linux raid
> > > autodetect
> > > /dev/sdb2          4196352 1874855935 1870659584   892G fd Linux raid
> > > autodetect
> > > /dev/sdb3       1874855936 1875385007     529072 258.3M 83 Linux
> > >
> > > I can fill it to the last sector using dd without problems:
> > >
> > > [root@vh3 ~]# dd if=/dev/zero of=/dev/sdb3 bs=1024 count=264536
> > > 264536+0 records in
> > > 264536+0 records out
> > > 270884864 bytes (271 MB, 258 MiB) copied, 4.81622 s, 56.2 MB/s
> > >
> > > When I do blkdiscard:
> > >
> > > root@vh3 ~]# blkdiscard -l 264536K /dev/sdb3
> > > blkdiscard: /dev/sdb3: BLKDISCARD ioctl failed: Remote I/O error
> > > [root@vh3 ~]# blkdiscard -l 264535K /dev/sdb3
> > > [root@vh3 ~]#
> > >
> > > In the /var/log/messages for the failed discard I get:
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 FAILED Result:
> > > hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Sense Key : Illegal
> > > Request [current]
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 Add. Sense: Logical
> > > block address out of range
> > > Feb 21 13:19:52 vh3 kernel: sd 1:0:1:0: [sdb] tag#2227 CDB: Unmap/Read
> > > sub-channel 42 00 00 00 00 00 00 00 18 00
> > > Feb 21 13:19:52 vh3 kernel: blk_update_request: critical target error, dev
> > > sdb, sector 1874855936 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 0
> > >
> > > I have the drive on a SAS controller - mpt3sas driver, LSI SAS2008
>
> Looks one target issue, CC linux-scsi and mpt3sas guys.
>
> > > > >
> > > > > I tried to trim entire drive but I get the following error:
> > > > > [root@vh3 util-linux-2.38-rc1]# ./blkdiscard /dev/sdb
> > > > > lt-blkdiscard: /dev/sdb: BLKDISCARD ioctl failed: Remote I/O error
> > > > >
> > > > > I have done strace and I see:
> > > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > > ioctl(3, BLKDISCARD, [0, 960197124096]) = -1 EREMOTEIO (Remote I/O error)
> > > > >
> > > > > When I do the same giving length explicitly I get the same error.
> > > > >
> > > > > However when I specify the length 512 bytes smaller, it works without a
> > > > > problem:
> > > > >
> > > > > ioctl(3, BLKGETSIZE64, [960197124096])  = 0
> > > > > ioctl(3, BLKSSZGET, [512])              = 0
> > > > > ioctl(3, BLKDISCARD, [0, 960197123584]) = 0
>
>
> Thanks,
> Ming
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: blkdiscard BLKDISCARD ioctl failed: Remote I/O error
       [not found]         ` <CAJWTG8_2bgioHW87VntCvhCOA8_B8GMsuk+82o7uuHPx=9yt1w@mail.gmail.com>
@ 2022-02-23  2:50           ` Martin K. Petersen
  0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-02-23  2:50 UTC (permalink / raw)
  To: Olaf Fraczyk
  Cc: Ming Lei, Lukas Czerner, linux-scsi, MPT-FusionLinux.pdl,
	Martin K. Petersen, Sathya Prakash, Karel Zak, linux-block


Olaf,

> You are right.  I moved the drive to onboard SATA controller and the
> problem disappeared.

Since the SCSI-ATA translation is done entirely inside the HBA I would
suggest looking into updating the controller firmware. The mpt3sas
driver doesn't really have anything to do with the discard handling in
this configuration.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-23  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAJWTG89dq0-HDb=hSJMdT5WyArH3dy+SKZNXDEr9WOWsaUsMEg@mail.gmail.com>
     [not found] ` <20220221090558.yvkgw2lujwjodhfi@ws.net.home>
     [not found]   ` <CAJWTG8-yrpLevVALX9ONnQGEgFcytYuhSk4ge_-qyi0tQS0keg@mail.gmail.com>
2022-02-21 13:09     ` blkdiscard BLKDISCARD ioctl failed: Remote I/O error Lukas Czerner
     [not found]       ` <CAJWTG89zxt3H41kaVjq9kSx=XSBwq=EpO9+1THydwG_-Xc6-ZQ@mail.gmail.com>
2022-02-21 13:47         ` Lukas Czerner
2022-02-21 14:45       ` Ming Lei
2022-02-21 15:50         ` Olaf Fraczyk
     [not found]         ` <CAJWTG8_2bgioHW87VntCvhCOA8_B8GMsuk+82o7uuHPx=9yt1w@mail.gmail.com>
2022-02-23  2:50           ` Martin K. Petersen

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.