]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: allow bmap to allocate blocks
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 22 Jul 2014 16:44:42 +0000 (12:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 22 Jul 2014 17:52:25 +0000 (13:52 -0400)
Allow set_inode_field's bmap command in debugfs to allocate blocks,
which enables us to allocate blocks for indirect blocks and internal
extent tree blocks.  True, we could do this manually, but seems like
unnecessary bookkeeping activity for humans.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/set_fields.c

index d017eea8b421012cfa2c032bce658c2178f10627..40dc5e7c5166055b05e3a2352092a75b6e385ef4 100644 (file)
@@ -554,8 +554,9 @@ static errcode_t parse_bmap(struct field_set_info *info,
        }
 
        retval = ext2fs_bmap2(current_fs, set_ino,
-                            (struct ext2_inode *) &set_inode,
-                            NULL, BMAP_SET, array_idx, NULL, &blk);
+                             (struct ext2_inode *) &set_inode,
+                             NULL, BMAP_ALLOC | BMAP_SET, array_idx, NULL,
+                             &blk);
        if (retval) {
                com_err("set_inode", retval, "while setting block map");
        }