e2fsprogs: remove redundant last-group check after ext2fs_group_last_block2

Submitted by Eric Sandeen on July 20, 2011, 9:49 p.m.

Details

Message ID 4E274D87.2040403@redhat.com
State Accepted, archived
Headers show

Commit Message

Eric Sandeen July 20, 2011, 9:49 p.m.
ext2fs_group_last_block2() already properly calculates
the last block in the last group, so there is no need
to special-case this after the call.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Theodore Ts'o Sept. 16, 2011, 1:33 p.m.
On Wed, Jul 20, 2011 at 11:49:59AM -0000, Eric Sandeen wrote:
> ext2fs_group_last_block2() already properly calculates
> the last block in the last group, so there is no need
> to special-case this after the call.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied with a slightly modified summary line:

   libext2fs: remove redundant last-group check in ext2fs_check_desc()

	   	  	    	       	     	- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c
index 7929cd9..7b68af4 100644
--- a/lib/ext2fs/check_desc.c
+++ b/lib/ext2fs/check_desc.c
@@ -53,8 +53,6 @@  errcode_t ext2fs_check_desc(ext2_filsys fs)
 					       EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
 			first_block = ext2fs_group_first_block2(fs, i);
 			last_block = ext2fs_group_last_block2(fs, i);
-			if (i == (fs->group_desc_count - 1))
-				last_block = ext2fs_blocks_count(fs->super)-1;
 		}
 
 		/*