aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2006-08-02 14:15:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-08-02 14:15:21 -0400
commitebf572b448757190027d8ee34e73deb989ec7b60 (patch)
tree2320a92b1aed2c9475e291d75c92616af75e195a /fs/ext3
parent48c86da1a211ef13bbfb1c8f2e35dda44a66b8a1 (diff)
parent49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff)
Merge branch 'from-linus' into bcm43xx
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/inode.c19
-rw-r--r--fs/ext3/namei.c15
2 files changed, 23 insertions, 11 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index f804d5e9d60c..c5ee9f0691e3 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1158,7 +1158,7 @@ retry:
1158 ret = PTR_ERR(handle); 1158 ret = PTR_ERR(handle);
1159 goto out; 1159 goto out;
1160 } 1160 }
1161 if (test_opt(inode->i_sb, NOBH)) 1161 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1162 ret = nobh_prepare_write(page, from, to, ext3_get_block); 1162 ret = nobh_prepare_write(page, from, to, ext3_get_block);
1163 else 1163 else
1164 ret = block_prepare_write(page, from, to, ext3_get_block); 1164 ret = block_prepare_write(page, from, to, ext3_get_block);
@@ -1244,7 +1244,7 @@ static int ext3_writeback_commit_write(struct file *file, struct page *page,
1244 if (new_i_size > EXT3_I(inode)->i_disksize) 1244 if (new_i_size > EXT3_I(inode)->i_disksize)
1245 EXT3_I(inode)->i_disksize = new_i_size; 1245 EXT3_I(inode)->i_disksize = new_i_size;
1246 1246
1247 if (test_opt(inode->i_sb, NOBH)) 1247 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1248 ret = nobh_commit_write(file, page, from, to); 1248 ret = nobh_commit_write(file, page, from, to);
1249 else 1249 else
1250 ret = generic_commit_write(file, page, from, to); 1250 ret = generic_commit_write(file, page, from, to);
@@ -1494,7 +1494,7 @@ static int ext3_writeback_writepage(struct page *page,
1494 goto out_fail; 1494 goto out_fail;
1495 } 1495 }
1496 1496
1497 if (test_opt(inode->i_sb, NOBH)) 1497 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1498 ret = nobh_writepage(page, ext3_get_block, wbc); 1498 ret = nobh_writepage(page, ext3_get_block, wbc);
1499 else 1499 else
1500 ret = block_write_full_page(page, ext3_get_block, wbc); 1500 ret = block_write_full_page(page, ext3_get_block, wbc);
@@ -2402,14 +2402,15 @@ static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb,
2402 struct buffer_head *bh; 2402 struct buffer_head *bh;
2403 struct ext3_group_desc * gdp; 2403 struct ext3_group_desc * gdp;
2404 2404
2405 2405 if (!ext3_valid_inum(sb, ino)) {
2406 if ((ino != EXT3_ROOT_INO && ino != EXT3_JOURNAL_INO && 2406 /*
2407 ino != EXT3_RESIZE_INO && ino < EXT3_FIRST_INO(sb)) || 2407 * This error is already checked for in namei.c unless we are
2408 ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)) { 2408 * looking at an NFS filehandle, in which case no error
2409 ext3_error(sb, "ext3_get_inode_block", 2409 * report is needed
2410 "bad inode number: %lu", ino); 2410 */
2411 return 0; 2411 return 0;
2412 } 2412 }
2413
2413 block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb); 2414 block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb);
2414 if (block_group >= EXT3_SB(sb)->s_groups_count) { 2415 if (block_group >= EXT3_SB(sb)->s_groups_count) {
2415 ext3_error(sb,"ext3_get_inode_block","group >= groups count"); 2416 ext3_error(sb,"ext3_get_inode_block","group >= groups count");
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index d9176dba3698..2aa7101b27cd 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1000,7 +1000,12 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str
1000 if (bh) { 1000 if (bh) {
1001 unsigned long ino = le32_to_cpu(de->inode); 1001 unsigned long ino = le32_to_cpu(de->inode);
1002 brelse (bh); 1002 brelse (bh);
1003 inode = iget(dir->i_sb, ino); 1003 if (!ext3_valid_inum(dir->i_sb, ino)) {
1004 ext3_error(dir->i_sb, "ext3_lookup",
1005 "bad inode number: %lu", ino);
1006 inode = NULL;
1007 } else
1008 inode = iget(dir->i_sb, ino);
1004 1009
1005 if (!inode) 1010 if (!inode)
1006 return ERR_PTR(-EACCES); 1011 return ERR_PTR(-EACCES);
@@ -1028,7 +1033,13 @@ struct dentry *ext3_get_parent(struct dentry *child)
1028 return ERR_PTR(-ENOENT); 1033 return ERR_PTR(-ENOENT);
1029 ino = le32_to_cpu(de->inode); 1034 ino = le32_to_cpu(de->inode);
1030 brelse(bh); 1035 brelse(bh);
1031 inode = iget(child->d_inode->i_sb, ino); 1036
1037 if (!ext3_valid_inum(child->d_inode->i_sb, ino)) {
1038 ext3_error(child->d_inode->i_sb, "ext3_get_parent",
1039 "bad inode number: %lu", ino);
1040 inode = NULL;
1041 } else
1042 inode = iget(child->d_inode->i_sb, ino);
1032 1043
1033 if (!inode) 1044 if (!inode)
1034 return ERR_PTR(-EACCES); 1045 return ERR_PTR(-EACCES);