diff options
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r-- | fs/ext3/inode.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index b5177c90d6f1..5d9b00e28837 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -491,7 +491,7 @@ static unsigned long ext3_find_goal(struct inode *inode, long block, | |||
491 | * the same format as ext3_get_branch() would do. We are calling it after | 491 | * the same format as ext3_get_branch() would do. We are calling it after |
492 | * we had read the existing part of chain and partial points to the last | 492 | * we had read the existing part of chain and partial points to the last |
493 | * triple of that (one with zero ->key). Upon the exit we have the same | 493 | * triple of that (one with zero ->key). Upon the exit we have the same |
494 | * picture as after the successful ext3_get_block(), excpet that in one | 494 | * picture as after the successful ext3_get_block(), except that in one |
495 | * place chain is disconnected - *branch->p is still zero (we did not | 495 | * place chain is disconnected - *branch->p is still zero (we did not |
496 | * set the last link), but branch->key contains the number that should | 496 | * set the last link), but branch->key contains the number that should |
497 | * be placed into *branch->p to fill that gap. | 497 | * be placed into *branch->p to fill that gap. |
@@ -523,7 +523,6 @@ static int ext3_alloc_branch(handle_t *handle, struct inode *inode, | |||
523 | if (!nr) | 523 | if (!nr) |
524 | break; | 524 | break; |
525 | branch[n].key = cpu_to_le32(nr); | 525 | branch[n].key = cpu_to_le32(nr); |
526 | keys = n+1; | ||
527 | 526 | ||
528 | /* | 527 | /* |
529 | * Get buffer_head for parent block, zero it out | 528 | * Get buffer_head for parent block, zero it out |
@@ -531,6 +530,9 @@ static int ext3_alloc_branch(handle_t *handle, struct inode *inode, | |||
531 | * parent to disk. | 530 | * parent to disk. |
532 | */ | 531 | */ |
533 | bh = sb_getblk(inode->i_sb, parent); | 532 | bh = sb_getblk(inode->i_sb, parent); |
533 | if (!bh) | ||
534 | break; | ||
535 | keys = n+1; | ||
534 | branch[n].bh = bh; | 536 | branch[n].bh = bh; |
535 | lock_buffer(bh); | 537 | lock_buffer(bh); |
536 | BUFFER_TRACE(bh, "call get_create_access"); | 538 | BUFFER_TRACE(bh, "call get_create_access"); |
@@ -864,6 +866,10 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode * inode, | |||
864 | if (!*errp && buffer_mapped(&dummy)) { | 866 | if (!*errp && buffer_mapped(&dummy)) { |
865 | struct buffer_head *bh; | 867 | struct buffer_head *bh; |
866 | bh = sb_getblk(inode->i_sb, dummy.b_blocknr); | 868 | bh = sb_getblk(inode->i_sb, dummy.b_blocknr); |
869 | if (!bh) { | ||
870 | *errp = -EIO; | ||
871 | goto err; | ||
872 | } | ||
867 | if (buffer_new(&dummy)) { | 873 | if (buffer_new(&dummy)) { |
868 | J_ASSERT(create != 0); | 874 | J_ASSERT(create != 0); |
869 | J_ASSERT(handle != 0); | 875 | J_ASSERT(handle != 0); |
@@ -896,6 +902,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode * inode, | |||
896 | } | 902 | } |
897 | return bh; | 903 | return bh; |
898 | } | 904 | } |
905 | err: | ||
899 | return NULL; | 906 | return NULL; |
900 | } | 907 | } |
901 | 908 | ||
@@ -1434,7 +1441,7 @@ static int ext3_invalidatepage(struct page *page, unsigned long offset) | |||
1434 | return journal_invalidatepage(journal, page, offset); | 1441 | return journal_invalidatepage(journal, page, offset); |
1435 | } | 1442 | } |
1436 | 1443 | ||
1437 | static int ext3_releasepage(struct page *page, int wait) | 1444 | static int ext3_releasepage(struct page *page, gfp_t wait) |
1438 | { | 1445 | { |
1439 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); | 1446 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); |
1440 | 1447 | ||