Patchwork [03/31] Define an error code for block bitmap checksum failures

login
register
mail settings
Submitter Darrick J. Wong
Date Oct. 1, 2013, 1:27 a.m.
Message ID <20131001012702.28415.85146.stgit@birch.djwong.org>
Download mbox | patch
Permalink /patch/279283/
State Accepted
Headers show

Comments

Darrick J. Wong - Oct. 1, 2013, 1:27 a.m.
Apparently libext2fs didn't have an error code defined for block bitmap
checksum errors, so add one.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 lib/ext2fs/ext2_err.et.in |    3 +++
 lib/ext2fs/rw_bitmaps.c   |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)



--
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
Theodore Ts'o - Oct. 13, 2013, 3:12 a.m.
On Mon, Sep 30, 2013 at 06:27:02PM -0700, Darrick J. Wong wrote:
> Apparently libext2fs didn't have an error code defined for block bitmap
> checksum errors, so add one.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Applied, thanks.

					- 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

diff --git a/lib/ext2fs/ext2_err.et.in b/lib/ext2fs/ext2_err.et.in
index de1b05b..d100acd 100644
--- a/lib/ext2fs/ext2_err.et.in
+++ b/lib/ext2fs/ext2_err.et.in
@@ -476,4 +476,7 @@  ec	EXT2_ET_MMP_CSUM_INVALID,
 ec	EXT2_ET_FILE_EXISTS,
 	"Ext2 file already exists"
 
+ec	EXT2_ET_BLOCK_BITMAP_CSUM_INVALID,
+	"Block bitmap checksum does not match bitmap"
+
 	end
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index cc14aaf..386cbeb 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -275,7 +275,7 @@  static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
 				    !ext2fs_block_bitmap_csum_verify(fs, i,
 						block_bitmap, block_nbytes)) {
 					retval =
-					EXT2_ET_BLOCK_BITMAP_READ;
+					EXT2_ET_BLOCK_BITMAP_CSUM_INVALID;
 					goto cleanup;
 				}
 			} else