instead refactor the outer scope to handle both restart conditions (goto agnostic):
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 9cc9e6c1d582..5052d1a6f6d8 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2428,13 +2428,15 @@ static int ext4_dx_add_entry(handle_t *handle,
struct ext4_filename *fname,
goto journal_error;
}
}
- de = do_split(handle, dir, &bh, frame, &fname->hinfo);
- if (IS_ERR(de)) {
- err = PTR_ERR(de);
+ if (!restart) {
+ de = do_split(handle, dir, &bh, frame, &fname->hinfo);
+ if (IS_ERR(de)) {
+ err = PTR_ERR(de);
+ goto cleanup;
+ }
+ err = add_dirent_to_buf(handle, fname, dir, inode, de,
bh);
goto cleanup;
}
- err = add_dirent_to_buf(handle, fname, dir, inode, de, bh);
- goto cleanup;
journal_error:
ext4_std_error(dir->i_sb, err); /* this is a no-op if err == 0
*/