All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Fajun Chen <fajunchen@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: Bugs on Linux 2.6.18-rc2 sg code?
Date: Fri, 18 Aug 2006 18:00:45 -0400	[thread overview]
Message-ID: <44E6388D.1000206@torque.net> (raw)
In-Reply-To: <8202f4270608101843r7df002d2l40e03eca3271b050@mail.gmail.com>

Fajun Chen wrote:
> Hi Folks,
> 
> I use ATA pass through via sg ioctl interface for data read/write.
> Linux 2.6.18-rc2 patched with Jeff Garzik's libata git patch was
> running on ARM IOP80321 board. The HBA Sil3124 was used.
> 
> Two problems were observed:
> 1. sg mmap bug?
>    My test program could not write data correctly to the mmapped
> buffer in the user space.      The program did a read immediately
> after a write and the data mismatches.  Swapped the sg_vma_nopage()
> function with the one in 2.6.15.4 release fixed the problem. So this
> appears to be a wrong change to the sg mmap code in 2.6.18-rc2
> release.

Thanks for the report. I can confirm that mmap-ed IO
in the sg driver is broken. Simply reading 16 blocks
from some arbitrary offset with sg_dd and sgm_dd
and comparing the fetched data shows mismatches starting
above the first page (i.e. above byte offset 4096 on
i386).

Your point about the change to sg_vma_nopage() between
lk 2.6.15 and lk 2.6.16 also seems to be correct.
The most indented part of that function has been
changed from incrementing the change count on the
reported page (as indicated by 'offset') in a
compound page allocation to ignoring the 'offset'
and incrementing the page count on the first page
in a compound page allocation.

> 2. sg hangs or have really slow response
>   Under certain unknown conditions, sg will be busy with one
> read/write ioctl call for over half an hour.  From scsi proc
> interface, sg and scsi mid layer were processing requests as  states
> "act" or "rcv" was shown in /proc/scsi/sg/debug. My test program set
> the command timeout to be 30 seconds, but this timeout did not trigger
> the command abort.

Well yes, I have noticed on transport errors, the attempt
to abort the command (or use a larger hammer) fails and
the command just keeps on chugging. The "elapsed" time
in the /proc/scsi/sg/debug just keeps on growing, typically
to a value much larger than the given timeout.

> Are these problems genuine bugs in sg 2.6.18-rc2 release? Since the
> problem is reproducible in my test hardware, please let me know if any
> log/traces can be collected.

I was able to confirm the breakage in point 1)
with a recent SATA disk with an old SIL 3112 controller
and with a SAS disk with some pretty recent MPT Fusion
hardware. That was enough for me.

> BTW, scsi logging through proc FS seems to be broken as well even
> though SCSI logging and Proc FS are enabled in my 2.6.18-rc2 kernel
> config.

Looks like we should be doing a lot more testing,
especially when our friends from other kernel areas
offer to clean up our code and remove cruft.

Doug Gilbert


  reply	other threads:[~2006-08-18 22:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-11  1:43 Bugs on Linux 2.6.18-rc2 sg code? Fajun Chen
2006-08-18 22:00 ` Douglas Gilbert [this message]
2006-08-19  4:11   ` Douglas Gilbert
2006-08-19 17:20     ` Matthew Wilcox
2006-08-19 17:36       ` Douglas Gilbert
2006-08-19 17:41         ` Andrew Morton
2006-08-19 20:23           ` Matthew Wilcox
2006-08-20  1:00             ` Douglas Gilbert
2006-08-20 10:07               ` Arjan van de Ven
2006-08-20 17:47                 ` Andrew Morton
2006-08-30 16:29                   ` Fajun Chen
2006-08-19 18:55     ` James Bottomley
2006-08-20  1:36       ` Douglas Gilbert
     [not found]     ` <8202f4270608200051p688f4654ub6aecb604e0152f1@mail.gmail.com>
2006-08-20  9:01       ` Russell King
2006-08-28 21:12     ` Fajun Chen
2006-08-28 22:11       ` Douglas Gilbert
2006-08-21 21:07   ` Fajun Chen
2006-08-22  2:47     ` Douglas Gilbert
2006-08-22  4:27       ` Fajun Chen

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=44E6388D.1000206@torque.net \
    --to=dougg@torque.net \
    --cc=fajunchen@gmail.com \
    --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.