diff mbox

[2/3] ext4: release buffer in failed path in dx_probe()

Message ID 1357371781-18194-2-git-send-email-yan@linux.vnet.ibm.com
State Accepted, archived
Headers show

Commit Message

Guo Chao Jan. 5, 2013, 7:43 a.m. UTC
If checksum fails, we should also release the buffer
read from previous iteration.

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
---
 fs/ext4/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick Wong Jan. 5, 2013, 7:41 p.m. UTC | #1
On Sat, Jan 05, 2013 at 03:43:00PM +0800, Guo Chao wrote:
> If checksum fails, we should also release the buffer
> read from previous iteration.
> 
> Cc: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
> ---
>  fs/ext4/namei.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index 843e29f..e249a47 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -722,7 +722,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
>  			ext4_warning(dir->i_sb, "Node failed checksum");
>  			brelse(bh);
>  			*err = ERR_BAD_DX_DIR;
> -			goto fail;
> +			goto fail2;

Good catch!

Acked-by: Darrick J. Wong <darrick.wong@oracle.com>

--D
>  		}
>  		set_buffer_verified(bh);
>  
> -- 
> 1.7.9.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o Jan. 7, 2013, 4:24 a.m. UTC | #2
On Sat, Jan 05, 2013 at 11:41:35AM -0800, Darrick J. Wong wrote:
> On Sat, Jan 05, 2013 at 03:43:00PM +0800, Guo Chao wrote:
> > If checksum fails, we should also release the buffer
> > read from previous iteration.
> > 
> > Cc: Darrick J. Wong <darrick.wong@oracle.com>
> > Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>

Thanks, applied.

> Acked-by: Darrick J. Wong <darrick.wong@oracle.com>

BTW, technically speaking it should be "Reviewed-by"; that's what I've
used in the commit.

"Acked-by:" gets used when a commit touches multiple subsystem trees.
For example, suppose someone changes a function in fs/direct-io.c,
which also required changes in btrfs, xfs, and ext4.  This commit
might go through Al Viro's vfs tree, and might have an Acked-by from
Chris Mason, Dave Chinner, and me, indicating that developers who are
well versed in those trees have agreed that the patches which touched
those other subsystems looked sane.

Since in this case the commit only touches ext4 code, and is going
through the ext4 tree, "Reviewed-by" is what normally gets used.

Cheers,

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 843e29f..e249a47 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -722,7 +722,7 @@  dx_probe(const struct qstr *d_name, struct inode *dir,
 			ext4_warning(dir->i_sb, "Node failed checksum");
 			brelse(bh);
 			*err = ERR_BAD_DX_DIR;
-			goto fail;
+			goto fail2;
 		}
 		set_buffer_verified(bh);