ext4: Change the return value of ext4_ext_journal_restart]
PATCH 2/5 ext4: Change the return value of ext4_ext_journal_restart]
ext4_ext_journal_restart does not return the return value of ext4_journal_extend and ext4_journal_restart. Fix it.
Signed-off-by Shen Feng <[email protected]>
--- fs/ext4/extents.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-)
fs/ext4/extents.c +8 -11
@@ -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 ); } -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;if (handle->h_buffer_credits > needed) -return handle; -if (!ext4_journal_extend (handle, needed)) -return handle; - err =ext4_journal_restart (handle, needed); - -return handle; +return 0 ; + err =ext4_journal_extend (handle, needed); +if (err) +return err; +return ext4_journal_restart (handle, needed); }/*
@@ -1885,11 +1884,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, credits +=2 *EXT4_QUOTA_TRANS_BLOCKS (inode->i_sb);#endif - handle =ext4_ext_journal_restart (handle, credits); -if (IS_ERR (handle)) { - err =PTR_ERR (handle); + err =ext4_ext_journal_restart (handle, credits); +if (err) goto out; - } err =ext4_ext_get_access (handle, inode, path + depth);if (err)
Signature · 1 line
1.5.4.5
Quoted 6 lines · Shen Feng
ext4_ext_journal_restartdoes not return the return value ofext4_journal_extendandext4_journal_restart. Fix it.Signed-off-by Shen Feng <[email protected]>
Reviewed-by Aneesh Kumar K.V <[email protected]>
We also need to update the defrag patches in the patchqueue to take care of the change
Quoted 54 lines
--- fs/ext4/extents.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-)fs/ext4/extents.c +8
-11@@ -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 ); } -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;if (handle->h_buffer_credits > needed) -return handle; -if (!ext4_journal_extend (handle, needed)) -return handle; - err =ext4_journal_restart (handle, needed); - -return handle; +return 0 ; + err =ext4_journal_extend (handle, needed); +if (err) +return err; +return ext4_journal_restart (handle, needed); }/* @@ -1885,11 +1884,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, credits +=2 *EXT4_QUOTA_TRANS_BLOCKS (inode->i_sb);#endif - handle =ext4_ext_journal_restart (handle, credits); -if (IS_ERR (handle)) { - err =PTR_ERR (handle); + err =ext4_ext_journal_restart (handle, credits); +if (err) goto out; - } err =ext4_ext_get_access (handle, inode, path + depth);if (err)Signature · 7 lines
1.5.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Shen Feng
ext4_ext_journal_restartdoes not return the return value ofext4_journal_extendandext4_journal_restart. Fix it.
Added to the patch queue.
Mingming
Quoted 47 lines
Signed-off-by Shen Feng <[email protected]>--- fs/ext4/extents.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-)fs/ext4/extents.c +8
-11@@ -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 ); } -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;if (handle->h_buffer_credits > needed) -return handle; -if (!ext4_journal_extend (handle, needed)) -return handle; - err =ext4_journal_restart (handle, needed); - -return handle; +return 0 ; + err =ext4_journal_extend (handle, needed); +if (err) +return err; +return ext4_journal_restart (handle, needed); }/* @@ -1885,11 +1884,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, credits +=2 *EXT4_QUOTA_TRANS_BLOCKS (inode->i_sb);#endif - handle =ext4_ext_journal_restart (handle, credits); -if (IS_ERR (handle)) { - err =PTR_ERR (handle); + err =ext4_ext_journal_restart (handle, credits); +if (err) goto out; - } err =ext4_ext_get_access (handle, inode, path + depth);if (err)