From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>, linux-ide@vger.kernel.org
Subject: [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation
Date: Thu, 16 Aug 2007 03:02:22 +0900 [thread overview]
Message-ID: <20070815180222.GC21623@htj.dyndns.org> (raw)
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;
}
next reply other threads:[~2007-08-15 18:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 18:02 Tejun Heo [this message]
2007-08-15 18:11 ` [PATCH #upstream-fixes] libata: fix n_sectors failure handling during revalidation Alan Cox
2007-08-23 9:25 ` Jeff Garzik
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=20070815180222.GC21623@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@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 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).