summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--e2fsck/recovery.c6
-rw-r--r--lib/ext2fs/Makefile.in5
-rw-r--r--lib/ext2fs/block.c3
-rw-r--r--lib/ext2fs/csum.c8
-rw-r--r--resize/main.c8
5 files changed, 22 insertions, 8 deletions
diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c
index 8e405756..cac9294c 100644
--- a/e2fsck/recovery.c
+++ b/e2fsck/recovery.c
@@ -536,8 +536,10 @@ static int do_one_pass(journal_t *journal,
memcpy(nbh->b_data, obh->b_data,
journal->j_blocksize);
if (flags & JFS_FLAG_ESCAPE) {
- *((__be32 *)nbh->b_data) =
- cpu_to_be32(JFS_MAGIC_NUMBER);
+ journal_header_t *header;
+
+ header = (journal_header_t *) &nbh->b_data[0];
+ header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
}
BUFFER_TRACE(nbh, "marking dirty");
diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in
index 763694d5..9c1c2733 100644
--- a/lib/ext2fs/Makefile.in
+++ b/lib/ext2fs/Makefile.in
@@ -327,10 +327,11 @@ tst_extents: $(srcdir)/extent.c extent_dbg.c $(DEBUG_OBJS) $(DEPLIBSS) \
$(STATIC_LIBEXT2FS) $(LIBBLKID) $(LIBUUID) $(LIBCOM_ERR) \
-I $(top_srcdir)/debugfs
-tst_csum: csum.c $(STATIC_LIBEXT2FS) $(DEPLIBCOM_ERR)
+tst_csum: csum.c $(STATIC_LIBEXT2FS) $(DEPLIBCOM_ERR) \
+ $(top_srcdir)/lib/e2p/e2p.h
$(E) " LD $@"
$(Q) $(CC) -o tst_csum $(srcdir)/csum.c -DDEBUG \
- $(ALL_CFLAGS) $(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
+ $(ALL_CFLAGS) $(STATIC_LIBEXT2FS) $(LIBCOM_ERR) $(LIBE2P)
mkjournal: mkjournal.c $(STATIC_LIBEXT2FS) $(DEPLIBCOM_ERR)
$(E) " LD $@"
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index ff0d8bd3..0e4ec775 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -110,7 +110,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block,
} else {
for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {
if (*block_nr == 0)
- continue;
+ goto skip_sparse;
blk64 = *block_nr;
flags = (*ctx->func)(ctx->fs, &blk64, ctx->bcount,
*ind_block, offset,
@@ -121,6 +121,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block,
ret |= BLOCK_ABORT;
break;
}
+ skip_sparse:
offset += sizeof(blk_t);
}
}
diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
index 0ef9ade5..58e29710 100644
--- a/lib/ext2fs/csum.c
+++ b/lib/ext2fs/csum.c
@@ -159,6 +159,8 @@ errcode_t ext2fs_set_gdt_csum(ext2_filsys fs)
}
#ifdef DEBUG
+#include "e2p/e2p.h"
+
void print_csum(const char *msg, ext2_filsys fs, dgrp_t group)
{
__u16 crc1, crc2, crc3;
@@ -195,9 +197,9 @@ void print_csum(const char *msg, ext2_filsys fs, dgrp_t group)
if (offset < size)
crc3 = ext2fs_crc16(crc3, (char *)desc + offset, size - offset);
- printf("%s: UUID %016Lx%016Lx(%04x), grp %u(%04x): %04x=%04x\n",
- msg, *(long long *)&sb->s_uuid, *(long long *)&sb->s_uuid[8],
- crc1, group, crc2, crc3, ext2fs_group_desc_csum(fs, group));
+ printf("%s: UUID %s(%04x), grp %u(%04x): %04x=%04x\n",
+ msg, e2p_uuid2str(sb->s_uuid), crc1, group, crc2, crc3,
+ ext2fs_group_desc_csum(fs, group));
}
unsigned char sb_uuid[16] = { 0x4f, 0x25, 0xe8, 0xcf, 0xe7, 0x97, 0x48, 0x23,
diff --git a/resize/main.c b/resize/main.c
index 7d8b287c..28a49ba2 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -392,6 +392,14 @@ int main (int argc, char ** argv)
exit(1);
}
} else {
+ /* Take down devices exactly 16T to 2^32-1 blocks */
+ if (max_size == (1ULL << 32))
+ max_size--;
+ else if (max_size > (1ULL << 32)) {
+ com_err(program_name, 0, _("New size too large to be "
+ "expressed in 32 bits\n"));
+ exit(1);
+ }
new_size = max_size;
/* Round down to an even multiple of a pagesize */
if (sys_page_size > fs->blocksize)