aboutsummaryrefslogtreecommitdiff
path: root/fs/ufs/util.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-08-07 06:38:41 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-07 06:38:41 -0400
commit242898be7a1921f646ca529ddc26d7337c69922f (patch)
tree674adf64ca6254318dab5bcd428ebe8ac73957ff /fs/ufs/util.c
parent6bbad18a8b18228fa65d73547dfd5efad1515ef8 (diff)
parent9f737633e6ee54fc174282d49b2559bd2208391d (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'fs/ufs/util.c')
-rw-r--r--fs/ufs/util.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 337cf2c46d1..22f820a9b15 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -251,12 +251,12 @@ struct page *ufs_get_locked_page(struct address_space *mapping,
{
struct page *page;
-try_again:
page = find_lock_page(mapping, index);
if (!page) {
page = read_cache_page(mapping, index,
(filler_t*)mapping->a_ops->readpage,
NULL);
+
if (IS_ERR(page)) {
printk(KERN_ERR "ufs_change_blocknr: "
"read_cache_page error: ino %lu, index: %lu\n",
@@ -266,6 +266,14 @@ try_again:
lock_page(page);
+ if (unlikely(page->mapping == NULL)) {
+ /* Truncate got there first */
+ unlock_page(page);
+ page_cache_release(page);
+ page = NULL;
+ goto out;
+ }
+
if (!PageUptodate(page) || PageError(page)) {
unlock_page(page);
page_cache_release(page);
@@ -275,15 +283,8 @@ try_again:
mapping->host->i_ino, index);
page = ERR_PTR(-EIO);
- goto out;
}
}
-
- if (unlikely(!page->mapping || !page_has_buffers(page))) {
- unlock_page(page);
- page_cache_release(page);
- goto try_again;/*we really need these buffers*/
- }
out:
return page;
}