diff options
author | Shen Feng <shen@cn.fujitsu.com> | 2008-07-11 19:27:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-11 19:27:31 -0400 |
commit | 9102e4fa8016af8bf1a263df913ee8fdafd4dfb0 (patch) | |
tree | f2d045cf2fd421d6ba6989b3eef966a40af5080b /fs/ext4/extents.c | |
parent | 1973adcba570c226de840299056e055a3614185e (diff) |
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: Shen Feng <shen@cn.fujitsu.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | 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 3e966daaadee..17ea8bb12aa5 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) | |||
92 | ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); | 92 | ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); |
93 | } | 93 | } |
94 | 94 | ||
95 | static handle_t *ext4_ext_journal_restart(handle_t *handle, int needed) | 95 | static int ext4_ext_journal_restart(handle_t *handle, int needed) |
96 | { | 96 | { |
97 | int err; | 97 | int err; |
98 | 98 | ||
99 | if (handle->h_buffer_credits > needed) | 99 | if (handle->h_buffer_credits > needed) |
100 | return handle; | 100 | return 0; |
101 | if (!ext4_journal_extend(handle, needed)) | 101 | err = ext4_journal_extend(handle, needed); |
102 | return handle; | 102 | if (err) |
103 | err = ext4_journal_restart(handle, needed); | 103 | return err; |
104 | 104 | return ext4_journal_restart(handle, needed); | |
105 | return handle; | ||
106 | } | 105 | } |
107 | 106 | ||
108 | /* | 107 | /* |
@@ -1888,11 +1887,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, | |||
1888 | credits += 2 * EXT4_QUOTA_TRANS_BLOCKS(inode->i_sb); | 1887 | credits += 2 * EXT4_QUOTA_TRANS_BLOCKS(inode->i_sb); |
1889 | #endif | 1888 | #endif |
1890 | 1889 | ||
1891 | handle = ext4_ext_journal_restart(handle, credits); | 1890 | err = ext4_ext_journal_restart(handle, credits); |
1892 | if (IS_ERR(handle)) { | 1891 | if (err) |
1893 | err = PTR_ERR(handle); | ||
1894 | goto out; | 1892 | goto out; |
1895 | } | ||
1896 | 1893 | ||
1897 | err = ext4_ext_get_access(handle, inode, path + depth); | 1894 | err = ext4_ext_get_access(handle, inode, path + depth); |
1898 | if (err) | 1895 | if (err) |