Skip to contentSkip to conversation

btrfs: tracepoints: fix error code in add_conflicting_inode()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 8 – Jun 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: tracepoints: fix error code in add_conflicting_inode()

This code had a second "ret" variable that shadowed the "real ret variable" so when we set the error code it was just discarded and we returned success. Get rid of the shadow variable.

Fixes 3e4489a270f2 ("btrfs: tracepoints: add trace event for add_conflicting_inode()")
---
 fs/btrfs/tree-log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-log.c +1 -1
index bcccddcc568c..f01a53e825b0 100644
@@ -6174,7 +6174,7 @@ static int add_conflicting_inode(struct btrfs_trans_handle *trans,
 	 *    some inode from it to some other directory).
 	 */
 	if (IS_ERR(inode)) {
-		int ret = PTR_ERR(inode);
+		ret = PTR_ERR(inode);
 
 		if (ret != -ENOENT)
 			goto out;
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

This code had a second "ret" variable that shadowed the "real ret variable" so when we set the error code it was just discarded and we returned success. Get rid of the shadow variable.

Fixes 3e4489a270f2 ("btrfs: tracepoints: add trace event for add_conflicting_inode()")

Folded into the original patch, thanks.

Quoted 21 lines
---
 fs/btrfs/tree-log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-log.c +1 -2
index bcccddcc568c..f01a53e825b0 100644
@@ -6174,7 +6174,7 @@ static int add_conflicting_inode(struct btrfs_trans_handle *trans,
         *    some inode from it to some other directory).
         */
        if (IS_ERR(inode)) {
-               int ret = PTR_ERR(inode);
+               ret = PTR_ERR(inode);
 
                if (ret != -ENOENT)
                        goto out;
--

2.53.0