linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Function btree_get_extent: Incorrect if-else if statement
@ 2010-08-09 10:47 André Nogueira
  2010-09-06 13:51 ` Andre Nogueira
  2010-09-06 14:15 ` Zhu Yanhai
  0 siblings, 2 replies; 3+ messages in thread
From: André Nogueira @ 2010-08-09 10:47 UTC (permalink / raw)
  To: linux-btrfs, linux-kernel

The btree_get_extent function (in file disk-io.c) calls the
add_extent_mapping (in file extent_map.c). The add_extent_mapping
function can return two values: 0 or -EEXIST.

After the call, it is used an if-else if statement. If the result is
-EEXIST, the if statement is executed. If the result is 0, the else if
statement will not be executed because it is false.

Thank you.

Signed-off-by: Andre Nogueira <andre.neo.net@gmail.com>

---
 fs/btrfs/disk-io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 34f7c37..76eb161 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -164,7 +164,7 @@ static struct extent_map *btree_get_extent(struct
inode *inode,
 						   failed_len);
 			ret = -EIO;
 		}
-	} else if (ret) {
+	} else {
 		free_extent_map(em);
 		em = NULL;
 	}
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-06 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 10:47 [PATCH] Function btree_get_extent: Incorrect if-else if statement André Nogueira
2010-09-06 13:51 ` Andre Nogueira
2010-09-06 14:15 ` Zhu Yanhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).