Messages in this thread | | | Date | Wed, 5 Jan 2005 09:31:55 -0800 | From | Nish Aravamudan <> | Subject | Re: [PATCH 2/3] osst upgrade to 0.99.3 |
| |
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |