Re: [PATCH] IDE: Fix HDIO_DRIVE_RESET handling

From: Bartlomiej Zolnierkiewicz
Date: Mon Jun 23 2008 - 18:46:25 EST



On Monday 23 June 2008, Elias Oltmanns wrote:
> Currently, the code path executing an HDIO_DRIVE_RESET ioctl is broken
> in various ways. Most importantly, it is treated as an out of band
> request in an illegal way which may very likely lead to system lock ups.
> Use the drive's request queue to avoid this problem (and fix a locking
> issue for free along the way).
>
> Signed-off-by: Elias Oltmanns <eo@xxxxxxxxxxxxxx>

[...]

> + } else if (!rq->rq_disk && blk_special_request(rq))
> + /*
> + * TODO: Once all ULDs have been modified to
> + * check for specific op codes rather than
> + * blindly accepting any special request, the
> + * echeck for ->rq_disk above may be replaced

'echeck' typo.

[...]

> +static inline void ide_complete_drive_reset(ide_drive_t *drive)
> +{
> + struct request *rq = HWGROUP(drive)->rq;
> +
> + if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET)

Shouldn't we be also checking for !rq->rq_disk here?

[ also HWGROUP() macro is on its way out ]

Otherwise OK.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/