2018-10-30 22:01:15

by Vasily Averin

[permalink] [raw]
Subject: [PATCH v2 10/11] ext4: remove useless brelse call in ext4_xattr_inode_update_ref()

brelse(iloc.bh) is useless here, it is always called with iloc.bh = NULL

Fixes dec214d00e0d ("ext4: xattr inode deduplication") # 4.13
cc: Tahsin Erdogan <[email protected]>

Signed-off-by: Vasily Averin <[email protected]>
---
fs/ext4/xattr.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index f36fc5d5b257..dc1aeab06dba 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1031,10 +1031,8 @@ static int ext4_xattr_inode_update_ref(handle_t *handle, struct inode *ea_inode,
inode_lock(ea_inode);

ret = ext4_reserve_inode_write(handle, ea_inode, &iloc);
- if (ret) {
- iloc.bh = NULL;
+ if (ret)
goto out;
- }

ref_count = ext4_xattr_inode_get_ref(ea_inode);
ref_count += ref_change;
@@ -1080,12 +1078,10 @@ static int ext4_xattr_inode_update_ref(handle_t *handle, struct inode *ea_inode,
}

ret = ext4_mark_iloc_dirty(handle, ea_inode, &iloc);
- iloc.bh = NULL;
if (ret)
ext4_warning_inode(ea_inode,
"ext4_mark_iloc_dirty() failed ret=%d", ret);
out:
- brelse(iloc.bh);
inode_unlock(ea_inode);
return ret;
}
--
2.17.1



2018-11-06 22:50:45

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH v2 10/11] ext4: remove useless brelse call in ext4_xattr_inode_update_ref()

On Wed, Oct 31, 2018 at 12:58:46AM +0300, Vasily Averin wrote:
> brelse(iloc.bh) is useless here, it is always called with iloc.bh = NULL
>
> Fixes dec214d00e0d ("ext4: xattr inode deduplication") # 4.13
> cc: Tahsin Erdogan <[email protected]>
>
> Signed-off-by: Vasily Averin <[email protected]>

Applied. I droppped the "Fixes" since it's really not needed for
stable kernel; this is really more of a cleanup. I used the commit
description:

ext4: remove unneeded brelse call in ext4_xattr_inode_update_ref()

- Ted