public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [Fwd: [PATCH 2/5] ext4: Change the return value of ext4_ext_journal_restart]
@ 2008-06-11  5:56 Shen Feng
  2008-06-11 11:36 ` Aneesh Kumar K.V
  2008-06-12 22:49 ` Mingming Cao
  0 siblings, 2 replies; 3+ messages in thread
From: Shen Feng @ 2008-06-11  5:56 UTC (permalink / raw)
  To: linux-ext4, Mingming Cao, Theodore Tso, Andrew Morton


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 <shen@cn.fujitsu.com>
---
 fs/ext4/extents.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index fa8a578..d4f76d7 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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)
-- 
1.5.4.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-12 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11  5:56 [Fwd: [PATCH 2/5] ext4: Change the return value of ext4_ext_journal_restart] Shen Feng
2008-06-11 11:36 ` Aneesh Kumar K.V
2008-06-12 22:49 ` Mingming Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox