diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2004-07-05 22:18:33 -0500 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2004-07-05 22:18:33 -0500 |
commit | c8ba8d59fb92e4e0a2b045210df5bb01cba03a5a (patch) | |
tree | 00dfd21c6b1e53094f38e14e82c7419a9fe87b80 /fs | |
parent | 07f0a148b27e12aa11086153ca9425d311e20522 (diff) | |
parent | 9cf7792d5e54e43d87e0bf917fdd3559ccdedc12 (diff) | |
download | history-c8ba8d59fb92e4e0a2b045210df5bb01cba03a5a.tar.gz |
Merge jfs@jfs.bkbits.net:linux-2.5
into austin.ibm.com:/shaggy/bk/jfs-2.5
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jfs/jfs_metapage.c | 10 | ||||
-rw-r--r-- | fs/jfs/jfs_xtree.c | 25 |
2 files changed, 17 insertions, 18 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 8c94bb015c845f..7f4d1dbae92c7a 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -225,8 +225,16 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, if (absolute) mapping = inode->i_sb->s_bdev->bd_inode->i_mapping; - else + 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; + } hash_ptr = meta_hash(mapping, lblock); again: diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c index fab2bbcfe09b49..252c0fd2adca49 100644 --- a/fs/jfs/jfs_xtree.c +++ b/fs/jfs/jfs_xtree.c @@ -1071,8 +1071,10 @@ xtSplitUp(tid_t tid, */ /* get/pin the parent page <sp> */ XT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc); - if (rc) - goto errout2; + if (rc) { + XT_PUTPAGE(rcmp); + return rc; + } /* * The new key entry goes ONE AFTER the index of parent entry, @@ -1106,8 +1108,10 @@ xtSplitUp(tid_t tid, rc = (sp->header.flag & BT_ROOT) ? xtSplitRoot(tid, ip, split, &rmp) : xtSplitPage(tid, ip, split, &rmp, &rbn); - if (rc) - goto errout1; + if (rc) { + XT_PUTPAGE(smp); + return rc; + } XT_PUTPAGE(smp); /* keep new child page <rp> pinned */ @@ -1170,19 +1174,6 @@ xtSplitUp(tid_t tid, XT_PUTPAGE(rmp); return 0; - - /* - * If something fails in the above loop we were already walking back - * up the tree and the tree is now inconsistent. - * release all pages we're holding. - */ - errout1: - XT_PUTPAGE(smp); - - errout2: - XT_PUTPAGE(rcmp); - - return rc; } |