linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation
@ 2007-08-15 18:02 Tejun Heo
  2007-08-15 18:11 ` Alan Cox
  2007-08-23  9:25 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2007-08-15 18:02 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

If revalidation fails because device has different n_sectors after
configuration the original n_sectors should be restored before failing
revalidation.  Without this fix, n_sectors difference will incorrectly
and silently pass revalidation when revalidation is retried.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-core.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: work/drivers/ata/libata-core.c
===================================================================
--- work.orig/drivers/ata/libata-core.c
+++ work/drivers/ata/libata-core.c
@@ -3705,6 +3705,10 @@ int ata_dev_revalidate(struct ata_device
 			       "%llu != %llu\n",
 			       (unsigned long long)n_sectors,
 			       (unsigned long long)dev->n_sectors);
+
+		/* restore original n_sectors */
+		dev->n_sectors = n_sectors;
+
 		rc = -ENODEV;
 		goto fail;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation
  2007-08-15 18:02 [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation Tejun Heo
@ 2007-08-15 18:11 ` Alan Cox
  2007-08-23  9:25 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2007-08-15 18:11 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Jeff Garzik, linux-ide

On Thu, 16 Aug 2007 03:02:22 +0900
Tejun Heo <htejun@gmail.com> wrote:

> If revalidation fails because device has different n_sectors after
> configuration the original n_sectors should be restored before failing
> revalidation.  Without this fix, n_sectors difference will incorrectly
> and silently pass revalidation when revalidation is retried.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>

Eeep

Acked-by: Alan Cox <alan@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation
  2007-08-15 18:02 [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation Tejun Heo
  2007-08-15 18:11 ` Alan Cox
@ 2007-08-23  9:25 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-08-23  9:25 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Tejun Heo wrote:
> If revalidation fails because device has different n_sectors after
> configuration the original n_sectors should be restored before failing
> revalidation.  Without this fix, n_sectors difference will incorrectly
> and silently pass revalidation when revalidation is retried.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/ata/libata-core.c |    4 ++++
>  1 file changed, 4 insertions(+)

applied



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-23  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 18:02 [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation Tejun Heo
2007-08-15 18:11 ` Alan Cox
2007-08-23  9:25 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).