Commit 9102e4fa authored by Shen Feng's avatar Shen Feng Committed by Theodore Ts'o

ext4: Fix ext4_ext_journal_restart() to reflect errors up to the caller

Fix ext4_ext_journal_restart() so it returns any errors reported by 
ext4_journal_extend() and ext4_journal_restart().
Signed-off-by: default avatarShen Feng <shen@cn.fujitsu.com>
Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 1973adcb
...@@ -92,17 +92,16 @@ static void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb) ...@@ -92,17 +92,16 @@ static void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb)
ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff);
} }
static handle_t *ext4_ext_journal_restart(handle_t *handle, int needed) static int ext4_ext_journal_restart(handle_t *handle, int needed)
{ {
int err; int err;
if (handle->h_buffer_credits > needed) if (handle->h_buffer_credits > needed)
return handle; return 0;
if (!ext4_journal_extend(handle, needed)) err = ext4_journal_extend(handle, needed);
return handle; if (err)
err = ext4_journal_restart(handle, needed); return err;
return ext4_journal_restart(handle, needed);
return handle;
} }
/* /*
...@@ -1888,11 +1887,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, ...@@ -1888,11 +1887,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
credits += 2 * EXT4_QUOTA_TRANS_BLOCKS(inode->i_sb); credits += 2 * EXT4_QUOTA_TRANS_BLOCKS(inode->i_sb);
#endif #endif
handle = ext4_ext_journal_restart(handle, credits); err = ext4_ext_journal_restart(handle, credits);
if (IS_ERR(handle)) { if (err)
err = PTR_ERR(handle);
goto out; goto out;
}
err = ext4_ext_get_access(handle, inode, path + depth); err = ext4_ext_get_access(handle, inode, path + depth);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment