Re: [PATCH 1/6] ext4: add missing brelse for bh2 in ext4_dx_add_entry
From: Markus Elfring
Date: Fri Dec 20 2024 - 08:21:13 EST
> Add missing brelse for bh2 in ext4_dx_add_entry.
* I propose to append parentheses to function names.
* How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc3#n145
…
> +++ b/fs/ext4/namei.c
> @@ -2580,8 +2580,10 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
> BUFFER_TRACE(frame->bh, "get_write_access");
> err = ext4_journal_get_write_access(handle, sb, frame->bh,
> EXT4_JTR_NONE);
> - if (err)
> + if (err) {
> + brelse(bh2);
> goto journal_error;
> + }
> if (!add_level) {
…
I suggest to add another jump target instead so that a bit of exception handling
can be better reused at the end of this function implementation.
Regards,
Markus