diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/namei.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index e7e1d79a7d75..757c1384c2d6 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -967,6 +967,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry, | |||
967 | (block<<EXT4_BLOCK_SIZE_BITS(sb)) | 967 | (block<<EXT4_BLOCK_SIZE_BITS(sb)) |
968 | +((char *)de - bh->b_data))) { | 968 | +((char *)de - bh->b_data))) { |
969 | brelse (bh); | 969 | brelse (bh); |
970 | *err = ERR_BAD_DX_DIR; | ||
970 | goto errout; | 971 | goto errout; |
971 | } | 972 | } |
972 | *res_dir = de; | 973 | *res_dir = de; |
@@ -1132,9 +1133,9 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, | |||
1132 | char *data1 = (*bh)->b_data, *data2; | 1133 | char *data1 = (*bh)->b_data, *data2; |
1133 | unsigned split; | 1134 | unsigned split; |
1134 | struct ext4_dir_entry_2 *de = NULL, *de2; | 1135 | struct ext4_dir_entry_2 *de = NULL, *de2; |
1135 | int err; | 1136 | int err = 0; |
1136 | 1137 | ||
1137 | bh2 = ext4_append (handle, dir, &newblock, error); | 1138 | bh2 = ext4_append (handle, dir, &newblock, &err); |
1138 | if (!(bh2)) { | 1139 | if (!(bh2)) { |
1139 | brelse(*bh); | 1140 | brelse(*bh); |
1140 | *bh = NULL; | 1141 | *bh = NULL; |
@@ -1143,14 +1144,9 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, | |||
1143 | 1144 | ||
1144 | BUFFER_TRACE(*bh, "get_write_access"); | 1145 | BUFFER_TRACE(*bh, "get_write_access"); |
1145 | err = ext4_journal_get_write_access(handle, *bh); | 1146 | err = ext4_journal_get_write_access(handle, *bh); |
1146 | if (err) { | 1147 | if (err) |
1147 | journal_error: | 1148 | goto journal_error; |
1148 | brelse(*bh); | 1149 | |
1149 | brelse(bh2); | ||
1150 | *bh = NULL; | ||
1151 | ext4_std_error(dir->i_sb, err); | ||
1152 | goto errout; | ||
1153 | } | ||
1154 | BUFFER_TRACE(frame->bh, "get_write_access"); | 1150 | BUFFER_TRACE(frame->bh, "get_write_access"); |
1155 | err = ext4_journal_get_write_access(handle, frame->bh); | 1151 | err = ext4_journal_get_write_access(handle, frame->bh); |
1156 | if (err) | 1152 | if (err) |
@@ -1193,8 +1189,16 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, | |||
1193 | goto journal_error; | 1189 | goto journal_error; |
1194 | brelse (bh2); | 1190 | brelse (bh2); |
1195 | dxtrace(dx_show_index ("frame", frame->entries)); | 1191 | dxtrace(dx_show_index ("frame", frame->entries)); |
1196 | errout: | ||
1197 | return de; | 1192 | return de; |
1193 | |||
1194 | journal_error: | ||
1195 | brelse(*bh); | ||
1196 | brelse(bh2); | ||
1197 | *bh = NULL; | ||
1198 | ext4_std_error(dir->i_sb, err); | ||
1199 | errout: | ||
1200 | *error = err; | ||
1201 | return NULL; | ||
1198 | } | 1202 | } |
1199 | #endif | 1203 | #endif |
1200 | 1204 | ||