From: Nish Aravamudan <nish.aravamudan@gmail.com>
To: Willem Riede <osst@riede.org>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/3] osst upgrade to 0.99.3
Date: Wed, 5 Jan 2005 09:31:55 -0800 [thread overview]
Message-ID: <29495f1d0501050931379525d1@mail.gmail.com> (raw)
In-Reply-To: <1104627573l.3427l.3l@serve.riede.org>
On Sun, 02 Jan 2005 00:59:33 +0000, Willem Riede <osst@riede.org> wrote:
> Here is patch 2 (see previous mail for context), providing osst error
> handling improvements.
<snip>
> + while (retval && time_before (jiffies, startwait + 5*60*HZ)) {
> +
> + if (STp->buffer->syscall_result && (SRpnt->sr_sense_buffer[2] & 0x0f) != 2) {
> +
> + /* some failure - not just not-ready */
> + retval = osst_write_error_recovery(STp, aSRpnt, 0);
> + break;
> + }
> + set_current_state(TASK_INTERRUPTIBLE);
> + schedule_timeout (HZ / OSST_POLL_PER_SEC);
Are you sure you want to use TASK_INTERRUPTIBLE here? If you are sure,
then you probably should add code which checks if schedule_timeout()
returns early because of signals (signals_pending(current) will be
true). Additionally, you may as well use msleep_interruptible(1000 /
OSST_POLL_PER_SEC), since you are requesting a 10th of a second sleep
(with OSST_POLL_PER_SEC #define'd to 10) (which is long & measurable
in milliseconds), you are not checking the return value (so you don't
seem to care how much time was left in the sleep) and
msleep_interruptible() will return on the same conditions as the
current code does. Seems like it should do what you want (still need
some means of checking for signals, though, I think).
If, in fact, you did not intend to use TASK_INTERRUPTIBLE, but
TASK_UNINTERRUPTIBLE, then you may want to consider using msleep(1000
/ OSST_POLL_PER_SEC) [ignoring signals in addition to waitqueue
events].
If, though, you want to keep the code as is, then please ignore the
noise and I apologize :)
Thanks,
Nish
prev parent reply other threads:[~2005-01-05 17:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-02 0:59 [PATCH 2/3] osst upgrade to 0.99.3 Willem Riede
2005-01-05 17:31 ` Nish Aravamudan [this message]
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=29495f1d0501050931379525d1@mail.gmail.com \
--to=nish.aravamudan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=osst@riede.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