diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-06 15:44:39 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-06 15:44:39 -0700 |
commit | dbd43d08642c037beb937c2670976c076120507b (patch) | |
tree | 4d44a4b54a731eb290e040345c38ed9e1e7ecc6a /fs/ufs | |
parent | c34c07d6946ec8969fa71ba03dbb95091f4eb9d3 (diff) | |
parent | 9f737633e6ee54fc174282d49b2559bd2208391d (diff) | |
download | op-kernel-dev-dbd43d08642c037beb937c2670976c076120507b.zip op-kernel-dev-dbd43d08642c037beb937c2670976c076120507b.tar.gz |
Merge branch 'master' of /home/greg/linux/git/torvalds-2.6/
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/balloc.c | 2 | ||||
-rw-r--r-- | fs/ufs/util.c | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index b01804b..b823814 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c @@ -248,7 +248,7 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk, if (likely(cur_index != index)) { page = ufs_get_locked_page(mapping, index); - if (IS_ERR(page)) + if (!page || IS_ERR(page)) /* it was truncated or EIO */ continue; } else page = locked_page; diff --git a/fs/ufs/util.c b/fs/ufs/util.c index 337cf2c..22f820a 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; } |