if (IS_ERR(page)) { 
if (IS_ERR(page) || !PageUptodate(mp->page)) { 
struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,				unsigned int size, int absolute,				unsigned long new){	int l2BlocksPerPage;	int l2bsize;	struct address_space *mapping;	struct metapage *mp = NULL;	struct page *page;	unsigned long page_index;	unsigned long page_offset;	jfs_info("__get_metapage: ino = %ld, lblock = 0x%lx, abs=%d",		 inode->i_ino, lblock, absolute);	l2bsize = inode->i_blkbits;	l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;	page_index = lblock >> l2BlocksPerPage;	page_offset = (lblock - (page_index << l2BlocksPerPage)) << l2bsize;	if ((page_offset + size) > PAGE_CACHE_SIZE) {		jfs_err("MetaData crosses page boundary!!");		jfs_err("lblock = %lx, size  = %d", lblock, size);		dump_stack();		return NULL;	}	if (absolute)		mapping = JFS_SBI(inode->i_sb)->direct_inode->i_mapping;	else {		/*		 * If an nfs client tries to read an inode that is larger		 * than any existing inodes, we may try to read past the		 * end of the inode map		 */		if ((lblock << inode->i_blkbits) >= inode->i_size)			return NULL;		mapping = inode->i_mapping;	}	if (new && (PSIZE == PAGE_CACHE_SIZE)) {		page = grab_cache_page(mapping, page_index);		if (!page) {			jfs_err("grab_cache_page failed!");			return NULL;		}		SetPageUptodate(page);	} else {		page = read_cache_page(mapping, page_index,			    (filler_t *)mapping->a_ops->readpage, NULL);		if (IS_ERR(page)) {			jfs_err("read_cache_page failed!");			return NULL;		}		lock_page(page);	}	mp = page_to_mp(page, page_offset);	if (mp) {		if (mp->logical_size != size) {			jfs_error(inode->i_sb,				  "__get_metapage: mp->logical_size != size");			jfs_err("logical_size = %d, size = %d",				mp->logical_size, size);			dump_stack();			goto unlock; 		}		mp->count++;		lock_metapage(mp);		if (test_bit(META_discard, &mp->flag)) {			if (!new) {				jfs_error(inode->i_sb,					  "__get_metapage: using a "					  "discarded metapage");				discard_metapage(mp);				goto unlock; 			}			clear_bit(META_discard, &mp->flag);		}	} else {		INCREMENT(mpStat.pagealloc);		mp = alloc_metapage(GFP_NOFS);		mp->page = page;		mp->flag = 0;		mp->xflag = COMMIT_PAGE;		mp->count = 1;		mp->nohomeok = 0;		mp->logical_size = size;		mp->data = page_address(page) + page_offset;		mp->index = lblock;		if (unlikely(insert_metapage(page, mp))) {			free_metapage(mp);			goto unlock;		}		lock_metapage(mp);	}	if (new) {		jfs_info("zeroing mp = 0x%p", mp);		memset(mp->data, 0, PSIZE);	}	unlock_page(page);	jfs_info("__get_metapage: returning = 0x%p data = 0x%p", mp, mp->data);	return mp;unlock:	unlock_page(page);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3d9b1cdd2455017c6aa25bc2442092b81438981f/jfs_metapage.c/buggy/fs/jfs/jfs_metapage.c