public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct
@ 2016-07-27  3:11 Salah Triki
  2016-07-27  3:11 ` [RESEND PATCH 2/4] fs: befs: Coding style fix Salah Triki
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Salah Triki @ 2016-07-27  3:11 UTC (permalink / raw)
  To: akpm, viro
  Cc: luisbg, mhocko, vdavydov, linux-fsdevel, linux-kernel,
	salah.triki

The only caller of befs_find_brun_direct is befs_fblock2brun, which
already validates that the block is within the range of direct blocks.
So remove the duplicate validation.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
 fs/befs/datastream.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c
index 26cc417..e224b9a 100644
--- a/fs/befs/datastream.c
+++ b/fs/befs/datastream.c
@@ -249,17 +249,9 @@ befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
 	int i;
 	const befs_block_run *array = data->direct;
 	befs_blocknr_t sum;
-	befs_blocknr_t max_block =
-	    data->max_direct_range >> BEFS_SB(sb)->block_shift;
 
 	befs_debug(sb, "---> %s, find %lu", __func__, (unsigned long)blockno);
 
-	if (blockno > max_block) {
-		befs_error(sb, "%s passed block outside of direct region",
-			   __func__);
-		return BEFS_ERR;
-	}
-
 	for (i = 0, sum = 0; i < BEFS_NUM_DIRECT_BLOCKS;
 	     sum += array[i].len, i++) {
 		if (blockno >= sum && blockno < sum + (array[i].len)) {
-- 
1.9.1

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

end of thread, other threads:[~2016-07-27 15:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27  3:11 [RESEND PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Salah Triki
2016-07-27  3:11 ` [RESEND PATCH 2/4] fs: befs: Coding style fix Salah Triki
2016-07-27  3:11 ` [RESEND PATCH 3/4] fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirect Salah Triki
2016-07-27  3:11 ` [RESEND PATCH 4/4] fs: befs: Remove goto from befs_bread_iaddr Salah Triki
2016-07-27 15:32   ` Luis de Bethencourt
2016-07-27 15:22 ` [RESEND PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Luis de Bethencourt

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