aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r--fs/reiserfs/inode.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index ffa34b861bdb..d60f6238c66a 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -627,11 +627,6 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
627 reiserfs_write_lock(inode->i_sb); 627 reiserfs_write_lock(inode->i_sb);
628 version = get_inode_item_key_version(inode); 628 version = get_inode_item_key_version(inode);
629 629
630 if (block < 0) {
631 reiserfs_write_unlock(inode->i_sb);
632 return -EIO;
633 }
634
635 if (!file_capable(inode, block)) { 630 if (!file_capable(inode, block)) {
636 reiserfs_write_unlock(inode->i_sb); 631 reiserfs_write_unlock(inode->i_sb);
637 return -EFBIG; 632 return -EFBIG;
@@ -934,12 +929,13 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
934 //pos_in_item * inode->i_sb->s_blocksize, 929 //pos_in_item * inode->i_sb->s_blocksize,
935 TYPE_INDIRECT, 3); // key type is unimportant 930 TYPE_INDIRECT, 3); // key type is unimportant
936 931
932 RFALSE(cpu_key_k_offset(&tmp_key) > cpu_key_k_offset(&key),
933 "green-805: invalid offset");
937 blocks_needed = 934 blocks_needed =
938 1 + 935 1 +
939 ((cpu_key_k_offset(&key) - 936 ((cpu_key_k_offset(&key) -
940 cpu_key_k_offset(&tmp_key)) >> inode->i_sb-> 937 cpu_key_k_offset(&tmp_key)) >> inode->i_sb->
941 s_blocksize_bits); 938 s_blocksize_bits);
942 RFALSE(blocks_needed < 0, "green-805: invalid offset");
943 939
944 if (blocks_needed == 1) { 940 if (blocks_needed == 1) {
945 un = &unf_single; 941 un = &unf_single;
@@ -2363,6 +2359,13 @@ static int reiserfs_write_full_page(struct page *page,
2363 int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize; 2359 int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize;
2364 th.t_trans_id = 0; 2360 th.t_trans_id = 0;
2365 2361
2362 /* no logging allowed when nonblocking or from PF_MEMALLOC */
2363 if (checked && (current->flags & PF_MEMALLOC)) {
2364 redirty_page_for_writepage(wbc, page);
2365 unlock_page(page);
2366 return 0;
2367 }
2368
2366 /* The page dirty bit is cleared before writepage is called, which 2369 /* The page dirty bit is cleared before writepage is called, which
2367 * means we have to tell create_empty_buffers to make dirty buffers 2370 * means we have to tell create_empty_buffers to make dirty buffers
2368 * The page really should be up to date at this point, so tossing 2371 * The page really should be up to date at this point, so tossing
@@ -2743,6 +2746,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
2743 int ret = 1; 2746 int ret = 1;
2744 struct reiserfs_journal *j = SB_JOURNAL(inode->i_sb); 2747 struct reiserfs_journal *j = SB_JOURNAL(inode->i_sb);
2745 2748
2749 lock_buffer(bh);
2746 spin_lock(&j->j_dirty_buffers_lock); 2750 spin_lock(&j->j_dirty_buffers_lock);
2747 if (!buffer_mapped(bh)) { 2751 if (!buffer_mapped(bh)) {
2748 goto free_jh; 2752 goto free_jh;
@@ -2758,7 +2762,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
2758 if (buffer_journaled(bh) || buffer_journal_dirty(bh)) { 2762 if (buffer_journaled(bh) || buffer_journal_dirty(bh)) {
2759 ret = 0; 2763 ret = 0;
2760 } 2764 }
2761 } else if (buffer_dirty(bh) || buffer_locked(bh)) { 2765 } else if (buffer_dirty(bh)) {
2762 struct reiserfs_journal_list *jl; 2766 struct reiserfs_journal_list *jl;
2763 struct reiserfs_jh *jh = bh->b_private; 2767 struct reiserfs_jh *jh = bh->b_private;
2764 2768
@@ -2784,6 +2788,7 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
2784 reiserfs_free_jh(bh); 2788 reiserfs_free_jh(bh);
2785 } 2789 }
2786 spin_unlock(&j->j_dirty_buffers_lock); 2790 spin_unlock(&j->j_dirty_buffers_lock);
2791 unlock_buffer(bh);
2787 return ret; 2792 return ret;
2788} 2793}
2789 2794