summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/fix-remount0001-yyy-fix-remount.patch144
-rw-r--r--debian/patches/series1
2 files changed, 145 insertions, 0 deletions
diff --git a/debian/patches/fix-remount0001-yyy-fix-remount.patch b/debian/patches/fix-remount0001-yyy-fix-remount.patch
new file mode 100644
index 00000000..87bda76f
--- /dev/null
+++ b/debian/patches/fix-remount0001-yyy-fix-remount.patch
@@ -0,0 +1,144 @@
+From a56055334da0127cc3e88f1529704b80a61e93a2 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 14 Jul 2015 14:28:57 +0200
+Subject: [PATCH hurd] yyy fix remount
+
+---
+ ext2fs/ext2fs.c | 1 -
+ ext2fs/hyper.c | 53 +++++++++++++++++++++++++++++------------------------
+ 2 files changed, 29 insertions(+), 25 deletions(-)
+
+diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
+index d0fdfe7..f1ec937 100644
+--- a/ext2fs/ext2fs.c
++++ b/ext2fs/ext2fs.c
+@@ -209,7 +209,6 @@ diskfs_reload_global_state ()
+ {
+ pokel_flush (&global_pokel);
+ pager_flush (diskfs_disk_pager, 1);
+- sblock = NULL;
+ get_hypermetadata ();
+ map_hypermetadata ();
+ return 0;
+diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
+index 5f288bf..afbbbc2 100644
+--- a/ext2fs/hyper.c
++++ b/ext2fs/hyper.c
+@@ -60,24 +60,22 @@ get_hypermetadata (void)
+ {
+ error_t err;
+ size_t read = 0;
+-
+- if (sblock != NULL)
+- munmap (sblock, SBLOCK_SIZE);
++ struct ext2_super_block *old_sblock, *new_sblock;
+
+ err = store_read (store, SBLOCK_OFFS >> store->log2_block_size,
+- SBLOCK_SIZE, (void **)&sblock, &read);
++ SBLOCK_SIZE, (void **)&new_sblock, &read);
+ if (err || read != SBLOCK_SIZE)
+ ext2_panic ("Cannot read hypermetadata");
+
+- if (sblock->s_magic != EXT2_SUPER_MAGIC
++ if (new_sblock->s_magic != EXT2_SUPER_MAGIC
+ #ifdef EXT2FS_PRE_02B_COMPAT
+- && sblock->s_magic != EXT2_PRE_02B_MAGIC
++ && new_sblock->s_magic != EXT2_PRE_02B_MAGIC
+ #endif
+ )
+ ext2_panic ("bad magic number %#x (should be %#x)",
+- sblock->s_magic, EXT2_SUPER_MAGIC);
++ new_sblock->s_magic, EXT2_SUPER_MAGIC);
+
+- log2_block_size = EXT2_MIN_BLOCK_LOG_SIZE + sblock->s_log_block_size;
++ log2_block_size = EXT2_MIN_BLOCK_LOG_SIZE + new_sblock->s_log_block_size;
+ block_size = 1 << log2_block_size;
+
+ if (block_size > EXT2_MAX_BLOCK_SIZE)
+@@ -97,10 +95,10 @@ get_hypermetadata (void)
+ ext2_panic ("block size %d isn't a power-of-two multiple of 512!",
+ block_size);
+
+- if ((store->size >> log2_block_size) < sblock->s_blocks_count)
++ if ((store->size >> log2_block_size) < new_sblock->s_blocks_count)
+ ext2_panic ("disk size (%qd bytes) too small; superblock says we need %qd",
+ (long long int) store->size,
+- (long long int) sblock->s_blocks_count << log2_block_size);
++ (long long int) new_sblock->s_blocks_count << log2_block_size);
+ if (log2_dev_blocks_per_fs_block != 0
+ && (store->size & ((1 << log2_dev_blocks_per_fs_block) - 1)) != 0)
+ ext2_warning ("%Ld (%zd byte) device blocks "
+@@ -109,42 +107,42 @@ get_hypermetadata (void)
+ store->block_size, block_size);
+
+ /* Set these handy variables. */
+- inodes_per_block = block_size / EXT2_INODE_SIZE (sblock);
++ inodes_per_block = block_size / EXT2_INODE_SIZE (new_sblock);
+
+- frag_size = EXT2_MIN_FRAG_SIZE << sblock->s_log_frag_size;
++ frag_size = EXT2_MIN_FRAG_SIZE << new_sblock->s_log_frag_size;
+ if (frag_size)
+ frags_per_block = block_size / frag_size;
+ else
+ ext2_panic ("frag size is zero!");
+
+- if (sblock->s_rev_level > EXT2_GOOD_OLD_REV)
++ if (new_sblock->s_rev_level > EXT2_GOOD_OLD_REV)
+ {
+- if (sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP)
++ if (new_sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP)
+ ext2_panic ("could not mount because of unsupported optional features"
+ " (0x%x)",
+- sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP);
+- if (sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)
++ new_sblock->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP);
++ if (new_sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)
+ {
+ ext2_warning ("mounted readonly because of"
+ " unsupported optional features (0x%x)",
+- sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP);
++ new_sblock->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP);
+ diskfs_readonly = 1;
+ }
+- if (sblock->s_inode_size != EXT2_GOOD_OLD_INODE_SIZE)
+- ext2_panic ("inode size %d isn't supported", sblock->s_inode_size);
++ if (new_sblock->s_inode_size != EXT2_GOOD_OLD_INODE_SIZE)
++ ext2_panic ("inode size %d isn't supported", new_sblock->s_inode_size);
+ }
+
+ groups_count =
+- ((sblock->s_blocks_count - sblock->s_first_data_block +
+- sblock->s_blocks_per_group - 1)
+- / sblock->s_blocks_per_group);
++ ((new_sblock->s_blocks_count - new_sblock->s_first_data_block +
++ new_sblock->s_blocks_per_group - 1)
++ / new_sblock->s_blocks_per_group);
+
+- itb_per_group = sblock->s_inodes_per_group / inodes_per_block;
++ itb_per_group = new_sblock->s_inodes_per_group / inodes_per_block;
+ desc_per_block = block_size / sizeof (struct ext2_group_desc);
+ addr_per_block = block_size / sizeof (block_t);
+ db_per_group = (groups_count + desc_per_block - 1) / desc_per_block;
+
+- ext2fs_clean = sblock->s_state & EXT2_VALID_FS;
++ ext2fs_clean = new_sblock->s_state & EXT2_VALID_FS;
+ if (! ext2fs_clean)
+ {
+ ext2_warning ("FILESYSTEM NOT UNMOUNTED CLEANLY; PLEASE fsck");
+@@ -163,6 +161,13 @@ get_hypermetadata (void)
+ zeroblock = (vm_address_t) mmap (0, block_size, PROT_READ, MAP_ANON, 0, 0);
+ assert (zeroblock != (vm_address_t) MAP_FAILED);
+ }
++
++ /* Switcherino! */
++ old_sblock = sblock;
++ sblock = new_sblock;
++ __sync_synchronize ();
++ if (old_sblock != NULL)
++ munmap (old_sblock, SBLOCK_SIZE);
+ }
+
+ static struct ext2_super_block *mapped_sblock;
+--
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 47d3aea4..95122f1e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -68,3 +68,4 @@ introspection0005-libdiskfs-annotate-objects-managed-by-libports.patch
introspection0006-libpager-annotate-objects-managed-by-libports.patch
introspection0007-ext2fs-annotate-objects-managed-by-libports.patch
introspection0008-utils-rpctrace-support-attaching-to-servers.patch
+fix-remount0001-yyy-fix-remount.patch