Skip to contentSkip to conversation

e2fsprogs - handle large setb/testb/freeb commands in debugfs

PATCH In review Eric Sandeen 2 participants 2 messages Apr 10, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsprogs - handle large setb/testb/freeb commands in debugfs

I noticed that you can't give more than a 2^31 block count to the debugfs commands setb, clearb, or freeb. Looks ok?

debugfs/debugfs.c +3 -3
Index: e2fsprogs-1.39_ext4_hg/debugfs/debugfs.c
===================================================================
@@ -726,7 +726,7 @@ void do_testi(int argc, char *argv[])
 void do_freeb(int argc, char *argv[])
 {
 	blk_t block;
-	int count = 1;
+	blk_t count = 1;
 
 	if (common_block_args_process(argc, argv, &block, &count))
 		return;
@@ -745,7 +745,7 @@ void do_freeb(int argc, char *argv[])
 void do_setb(int argc, char *argv[])
 {
 	blk_t block;
-	int count = 1;
+	blk_t count = 1;
 
 	if (common_block_args_process(argc, argv, &block, &count))
 		return;
@@ -764,7 +764,7 @@ void do_setb(int argc, char *argv[])
 void do_testb(int argc, char *argv[])
 {
 	blk_t block;
-	int count = 1;
+	blk_t count = 1;
 
 	if (common_block_args_process(argc, argv, &block, &count))
 		return;
debugfs/util.c +1 -1
Index: e2fsprogs-1.39_ext4_hg/debugfs/util.c
===================================================================
@@ -325,7 +325,7 @@ int common_inode_args_process(int argc, 
  * This is a helper function used by do_freeb, do_setb, and do_testb
  */
 int common_block_args_process(int argc, char *argv[],
-			      blk_t *block, int *count)
+			      blk_t *block, blk_t *count)
 {
 	int	err;
 
debugfs/debugfs.h +1 -1
Index: e2fsprogs-1.39_ext4_hg/debugfs/debugfs.h
===================================================================
@@ -41,7 +41,7 @@ extern int common_args_process(int argc,
 extern int common_inode_args_process(int argc, char *argv[],
 				     ext2_ino_t *inode, int flags);
 extern int common_block_args_process(int argc, char *argv[],
-				     blk_t *block, int *count);
+				     blk_t *block, blk_t *count);
 extern int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode,
 			      const char *cmd);
 extern int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode,
#1 lore raw
Quoted 2 lines · Eric Sandeen

I noticed that you can't give more than a 2^31 block count to the debugfs commands setb, clearb, or freeb. Looks ok?

Yup, thanks. Committed into the repository.

- Ted