All of lore.kernel.org
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
	luisbg@osg.samsung.com
Cc: linux-kernel@vger.kernel.org, salah.triki@gmail.com
Subject: [PATCH 3/4] befs: remove the validation of allocation group number
Date: Wed, 10 Aug 2016 23:12:32 +0100	[thread overview]
Message-ID: <7008e2c3fbeb855b1670487959f13ffb776ac31c.1470867071.git.salah.triki@gmail.com> (raw)
In-Reply-To: <8f7f9b76ead677bdc834867e549ea6c4d1c04ccd.1470867071.git.salah.triki@gmail.com>
In-Reply-To: <8f7f9b76ead677bdc834867e549ea6c4d1c04ccd.1470867071.git.salah.triki@gmail.com>

Validating the allocation group number is unnecessary since it will
be done by iaddr2blockno().

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 fs/befs/io.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/befs/io.c b/fs/befs/io.c
index 14eef7d..f9790f5 100644
--- a/fs/befs/io.c
+++ b/fs/befs/io.c
@@ -28,18 +28,11 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
 {
 	struct buffer_head *bh;
 	befs_blocknr_t block = 0;
-	struct befs_sb_info *befs_sb = BEFS_SB(sb);
 
 	befs_debug(sb, "---> Enter %s "
 		   "[%u, %hu, %hu]", __func__, iaddr.allocation_group,
 		   iaddr.start, iaddr.len);
 
-	if (iaddr.allocation_group > befs_sb->num_ags) {
-		befs_error(sb, "BEFS: Invalid allocation group %u, max is %u",
-			   iaddr.allocation_group, befs_sb->num_ags);
-		goto error;
-	}
-
 	block = iaddr2blockno(sb, &iaddr);
 
 	if (block == BEFS_ERR)
-- 
1.9.1

  parent reply	other threads:[~2016-08-10 22:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 22:12 [PATCH 1/4] befs: check allocation_group number before use Salah Triki
2016-08-10 22:12 ` [PATCH 2/4] befs: check return value of iaddr2blockno Salah Triki
2016-08-10 22:12 ` Salah Triki [this message]
2016-08-10 22:12 ` [PATCH 4/4] befs: remove unnecessary initialization Salah Triki
2016-08-11 11:07   ` Luis de Bethencourt
2016-08-11 10:56 ` [PATCH 1/4] befs: check allocation_group number before use Luis de Bethencourt
2016-08-12  7:26   ` Salah Triki
2016-08-12  9:38     ` Luis de Bethencourt
2016-08-12 10:17       ` Salah Triki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7008e2c3fbeb855b1670487959f13ffb776ac31c.1470867071.git.salah.triki@gmail.com \
    --to=salah.triki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luisbg@osg.samsung.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.