diff mbox

[3/3] ext4: remove duplicate assignment in ext4_init_new_dir()

Message ID 1357371781-18194-3-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
It should be a typo unless I miss something.

Cc: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
---
 fs/ext4/namei.c |    1 -
 1 file changed, 1 deletion(-)

Comments

Tao Ma Jan. 5, 2013, 8:05 a.m. UTC | #1
On 01/05/2013 03:43 PM, Guo Chao wrote:
> It should be a typo unless I miss something.
> 
> Cc: Tao Ma <boyu.mt@taobao.com>
> Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
oh, you are right. Thanks for the fix. And I really can't recall how I
messed this up.

Acked-by: Tao Ma <boyu.mt@taobao.com>
> ---
>  fs/ext4/namei.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index e249a47..db3b1e9 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -2368,7 +2368,6 @@ static int ext4_init_new_dir(handle_t *handle, struct inode *dir,
>  	}
>  
>  	inode->i_size = EXT4_I(inode)->i_disksize = blocksize;
> -	dir_block = ext4_bread(handle, inode, 0, 1, &err);
>  	if (!(dir_block = ext4_bread(handle, inode, 0, 1, &err))) {
>  		if (!err) {
>  			err = -EIO;
> 

--
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:37 a.m. UTC | #2
On Sat, Jan 05, 2013 at 03:43:01PM +0800, Guo Chao wrote:
> It should be a typo unless I miss something.
> 
> Cc: Tao Ma <boyu.mt@taobao.com>
> Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>

Thanks, applied.  Note that this fixes a buffer cache leak when
creating a directory using the mkdir system call.

	   	     	       	     - 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 e249a47..db3b1e9 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2368,7 +2368,6 @@  static int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 	}
 
 	inode->i_size = EXT4_I(inode)->i_disksize = blocksize;
-	dir_block = ext4_bread(handle, inode, 0, 1, &err);
 	if (!(dir_block = ext4_bread(handle, inode, 0, 1, &err))) {
 		if (!err) {
 			err = -EIO;