public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: Remove arbitrary block value in __es_remove_extent()
@ 2014-04-15 18:08 Lukas Czerner
  2014-04-15 18:08 ` [PATCH 2/2] ext4: Use EXT_MAX_BLOCKS in ext4_es_can_be_merged() Lukas Czerner
  2014-04-17 16:19 ` [PATCH 1/2] ext4: Remove arbitrary block value in __es_remove_extent() Theodore Ts'o
  0 siblings, 2 replies; 8+ messages in thread
From: Lukas Czerner @ 2014-04-15 18:08 UTC (permalink / raw)
  To: linux-ext4; +Cc: Lukas Czerner

In __es_remove_extent() we're storing seemingly arbitrary value
0x7FDEADBEEF into block variable. I assume that the reason is just to
initialize the variable before the use because the actual value does not
matter at this point.

Just remove the arbitrary value and initialized block variable to zero
which is much less suspicious.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/extents_status.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 33682aa..3c47b4e 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -782,7 +782,7 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk,
 	struct extent_status *es;
 	struct extent_status orig_es;
 	ext4_lblk_t len1, len2;
-	ext4_fsblk_t block;
+	ext4_fsblk_t block = 0;
 	int err;
 
 retry:
@@ -810,7 +810,6 @@ retry:
 
 			newes.es_lblk = end + 1;
 			newes.es_len = len2;
-			block = 0x7FDEADBEEF;
 			if (ext4_es_is_written(&orig_es) ||
 			    ext4_es_is_unwritten(&orig_es))
 				block = ext4_es_pblock(&orig_es) +
-- 
1.8.3.1


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

end of thread, other threads:[~2014-05-13  2:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 18:08 [PATCH 1/2] ext4: Remove arbitrary block value in __es_remove_extent() Lukas Czerner
2014-04-15 18:08 ` [PATCH 2/2] ext4: Use EXT_MAX_BLOCKS in ext4_es_can_be_merged() Lukas Czerner
2014-04-23  7:27   ` Zheng Liu
2014-05-13  2:25   ` [2/2] " Theodore Ts'o
2014-04-17 16:19 ` [PATCH 1/2] ext4: Remove arbitrary block value in __es_remove_extent() Theodore Ts'o
2014-04-18  9:22   ` Lukáš Czerner
2014-04-18 11:18     ` Theodore Ts'o
2014-04-18 11:24       ` Lukáš Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox