Skip to contentSkip to conversation

Bug#604049: linux-image-2.6.32-5-amd64: data corruption with promise stex driver and use of device-mapper layers (lvm/dm-crypt/..)

DISCUSSION Ben Hutchings 2 participants 2 messages Nov 20, 2010 – Nov 22, 2010 1 message not in the archive Device mapper

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Markus Schulz

Package: linux-2.6
Version: 2.6.32-27
Severity: critical
Tags: d-i upstream
Justification: causes serious data loss

any use of the stex.ko promise hw-raid controller driver with a device-mapper layer produces data corruption (or filesystem corruption like you can see in my dmesg).

[...]

Quoted 10 lines

i've asked Ed Lin (Maintainer of stex.c from promise) on lkml and got the following answer:

Quoted 8 lines

We found similar problem during test.

The stex driver sets sg_tablesize as 32 (for st_yel it's 38) in the probe entry. It seems that this value was overridden by the system if using dm/lvm, for unknown reason. The driver received requests with more sg items than registered. Sg item number could be as high as 64. This is completely unexpected. The firmware could not handle such requests, and error occurred.

[..]

I have little idea how this stuff is supposed to work, but it looks like dm_dispatch_request() calls blk_insert_cloned_request() which calls blk_rq_check_limits() which checks the request against the maximum number of segments initialised from sg_tablesize.

We can perhaps mitigate the data loss by checking the number of segments again in scsi_dispatch_cmd(), but it won't really solve the problem.

Ben.

Signature · 2 lines
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
#2 lore raw
Quoted 46 lines

-----Original Message-----
From: Ben Hutchings [mailto:[email protected]]
Sent: 2010年11月19日 21:34
To: Ed Lin - PTU; Jens Axboe; [email protected]
Cc: Markus Schulz; [email protected]
Subject: Re: Bug#604049: linux-image-2.6.32-5-amd64: data corruption with promise stex driver and use of device-mapper layers (lvm/dm-crypt/..)

Quoted 8 lines · Markus Schulz

Package: linux-2.6
Version: 2.6.32-27
Severity: critical
Tags: d-i upstream
Justification: causes serious data loss

any use of the stex.ko promise hw-raid controller driver with a device-mapper layer produces data corruption (or filesystem

corruption

Quoted 1 line

like you can see in my dmesg).

[...]

Quoted 1 line

i've asked Ed Lin (Maintainer of stex.c from promise) on

lkml and got the following answer:

Quoted 4 lines
Quoted 4 lines

We found similar problem during test.

The stex driver sets sg_tablesize as 32 (for st_yel it's

38) in the probe

Quoted 1 line
Quoted 1 line

entry. It seems that this value was overridden by the

system if using

Quoted 2 lines
Quoted 2 lines

dm/lvm, for unknown reason. The driver received requests with more sg items than registered. Sg item number could be as high

as 64. This

Quoted 2 lines
Quoted 2 lines

is completely unexpected. The firmware could not handle such requests, and error occurred.

[..]

I have little idea how this stuff is supposed to work, but it looks like
dm_dispatch_request() calls blk_insert_cloned_request() which calls blk_rq_check_limits() which checks the request against the maximum number of segments initialised from sg_tablesize.

Quoted 4 lines

We can perhaps mitigate the data loss by checking the number of segments
again in scsi_dispatch_cmd(), but it won't really solve the problem.

I believe the cause of the problem has been found. An explanation and a possible solution was posted at the linux-scsi mail list and [email protected].

The link is http://marc.info/?l=linux-scsi&m=129021716922966&w=2
So far no one responded. Any comment is welcome.

Thanks,
Ed Lin