lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 06 Jul 2012 14:27:44 +0800
From:	Wang Sheng-Hui <shhuiw@...il.com>
To:	Theodore Ts'o <tytso@....edu>,
	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] ext4: make extents.c/ext4_ext_try_to_merge return 1 on
 merged

In the old version, ext4_ext_try_to_merge would return 0 if
merge left or no merge, and return 1 if merge right.
Here make ext4_ext_try_to_merge return 1 on merged, and return
0 if no merge.

Signed-off-by: Wang Sheng-Hui <shhuiw@...il.com>
---
 fs/ext4/extents.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 6c2a37d..7f6fb48 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1657,7 +1657,7 @@ static int ext4_ext_try_to_merge_right(struct inode *inode,
 
 /*
  * This function tries to merge the @ex extent to neighbours in the tree.
- * return 1 if merge left else 0.
+ * return 1 if merged else 0.
  */
 static int ext4_ext_try_to_merge(struct inode *inode,
 				  struct ext4_ext_path *path,
@@ -1665,7 +1665,6 @@ static int ext4_ext_try_to_merge(struct inode *inode,
 	struct ext4_extent_header *eh;
 	unsigned int depth;
 	int merge_done = 0;
-	int ret = 0;
 
 	depth = ext_depth(inode);
 	BUG_ON(path[depth].p_hdr == NULL);
@@ -1675,9 +1674,9 @@ static int ext4_ext_try_to_merge(struct inode *inode,
 		merge_done = ext4_ext_try_to_merge_right(inode, path, ex - 1);
 
 	if (!merge_done)
-		ret = ext4_ext_try_to_merge_right(inode, path, ex);
+		merge_done = ext4_ext_try_to_merge_right(inode, path, ex);
 
-	return ret;
+	return merge_done;
 }
 
 /*
-- 
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists