From 6ba3afe933a8cb3c5e99534d78f7b828061b7247 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Wed, 21 Nov 2018 17:33:02 +0200 Subject: [PATCH] [udisks2] Reduce reserved blocks percentage to zero for ext2/ext3/ext4 formatting. Fixes JB#43106 --- ...dev-mdraid-and-part-support-from-sou.patch | 46 +++++++++---------- rpm/0002-Drop-smartata-dependencies.patch | 10 ++-- ...t-policies-to-work-from-another-seat.patch | 6 +-- ...-sd-service-that-is-executed-as-nemo.patch | 8 ++-- ...005-Add-udev-rule-for-the-sda-drives.patch | 4 +- rpm/0006-Disable-zram-rule-for-now.patch | 8 ++-- ...07-Create-mount-path-with-755-rights.patch | 6 +-- ...-to-encrypt-mmcblk-format-with-encry.patch | 10 ++-- ...blocks-percentage-to-zero-for-ext2-e.patch | 45 ++++++++++++++++++ rpm/udisks2.spec | 2 + 10 files changed, 96 insertions(+), 49 deletions(-) create mode 100644 rpm/0009-Reduce-reserved-blocks-percentage-to-zero-for-ext2-e.patch diff --git a/rpm/0001-Disable-libblockdev-mdraid-and-part-support-from-sou.patch b/rpm/0001-Disable-libblockdev-mdraid-and-part-support-from-sou.patch index f005025..3c807ba 100644 --- a/rpm/0001-Disable-libblockdev-mdraid-and-part-support-from-sou.patch +++ b/rpm/0001-Disable-libblockdev-mdraid-and-part-support-from-sou.patch @@ -1,7 +1,7 @@ -From d80468db70396c4bf9046d3b6c0842376df98476 Mon Sep 17 00:00:00 2001 +From 3b0df7a516a1523f96f43b906a470ad1de80c1a1 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Tue, 5 Dec 2017 11:17:50 +0200 -Subject: [PATCH 1/8] Disable libblockdev-mdraid and part support from source +Subject: [PATCH 1/9] Disable libblockdev-mdraid and part support from source tree Signed-off-by: Raine Makelainen @@ -17,10 +17,10 @@ Signed-off-by: Raine Makelainen 8 files changed, 105 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac -index 5f1b0af4..61972a62 100644 +index a20abea3..aea49bf7 100644 --- a/configure.ac +++ b/configure.ac -@@ -611,10 +611,6 @@ AC_TRY_COMPILE([#include ], [], +@@ -606,10 +606,6 @@ AC_TRY_COMPILE([#include ], [], CFLAGS=$SAVE_CFLAGS LDFLAGS=$SAVE_LDFLAGS @@ -97,7 +97,7 @@ index 1f649d7c..eb404503 100644 error = NULL; diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c -index 6a69bf3e..2a8ed305 100644 +index fd82d0e4..e5bbc190 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -20,6 +20,10 @@ @@ -121,7 +121,7 @@ index 6a69bf3e..2a8ed305 100644 #include #include "udiskslogging.h" -@@ -2889,7 +2895,10 @@ udisks_linux_block_handle_format (UDisksBlock *block, +@@ -2911,7 +2917,10 @@ udisks_linux_block_handle_format (UDisksBlock *block, GVariant *config_items = NULL; gboolean teardown_flag = FALSE; gboolean no_discard_flag = FALSE; @@ -132,7 +132,7 @@ index 6a69bf3e..2a8ed305 100644 error = NULL; object = udisks_daemon_util_dup_object (block, &error); -@@ -3263,11 +3272,13 @@ udisks_linux_block_handle_format (UDisksBlock *block, +@@ -3285,11 +3294,13 @@ udisks_linux_block_handle_format (UDisksBlock *block, } } @@ -146,7 +146,7 @@ index 6a69bf3e..2a8ed305 100644 { /* Build and run mkfs shell command */ const gchar *device = udisks_block_get_device (block_to_mkfs); -@@ -3295,6 +3306,8 @@ udisks_linux_block_handle_format (UDisksBlock *block, +@@ -3317,6 +3328,8 @@ udisks_linux_block_handle_format (UDisksBlock *block, goto out; } } @@ -155,7 +155,7 @@ index 6a69bf3e..2a8ed305 100644 else { /* Create the partition table. */ -@@ -3304,6 +3317,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, +@@ -3326,6 +3339,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, goto out; } } @@ -314,7 +314,7 @@ index 51bdf708..0d8e96c1 100644 /* ---------------------------------------------------------------------------------------------------- */ diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c -index 5fa20482..7260c00f 100644 +index e490d21c..983d2bf3 100644 --- a/src/udiskslinuxpartition.c +++ b/src/udiskslinuxpartition.c @@ -18,6 +18,10 @@ @@ -338,7 +338,7 @@ index 5fa20482..7260c00f 100644 #include "udiskslogging.h" #include "udiskslinuxpartition.h" -@@ -292,6 +298,7 @@ handle_set_flags (UDisksPartition *partition, +@@ -327,6 +333,7 @@ handle_set_flags (UDisksPartition *partition, guint64 flags, GVariant *options) { @@ -346,7 +346,7 @@ index 5fa20482..7260c00f 100644 UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; -@@ -419,7 +426,7 @@ handle_set_flags (UDisksPartition *partition, +@@ -454,7 +461,7 @@ handle_set_flags (UDisksPartition *partition, g_clear_object (&partition_table); g_clear_object (&partition_table_block); g_clear_object (&object); @@ -355,7 +355,7 @@ index 5fa20482..7260c00f 100644 return TRUE; /* returning TRUE means that we handled the method invocation */ } -@@ -432,6 +439,7 @@ handle_set_name (UDisksPartition *partition, +@@ -467,6 +474,7 @@ handle_set_name (UDisksPartition *partition, const gchar *name, GVariant *options) { @@ -363,7 +363,7 @@ index 5fa20482..7260c00f 100644 UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; -@@ -536,7 +544,7 @@ handle_set_name (UDisksPartition *partition, +@@ -571,7 +579,7 @@ handle_set_name (UDisksPartition *partition, g_clear_object (&partition_table); g_clear_object (&partition_table_block); g_clear_object (&object); @@ -372,7 +372,7 @@ index 5fa20482..7260c00f 100644 return TRUE; /* returning TRUE means that we handled the method invocation */ } -@@ -593,6 +601,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, +@@ -628,6 +636,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, GCancellable *cancellable, GError **error) { @@ -380,7 +380,7 @@ index 5fa20482..7260c00f 100644 gboolean ret = FALSE; UDisksBlock *block = NULL; UDisksObject *object = NULL; -@@ -724,8 +733,10 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, +@@ -759,8 +768,10 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, g_clear_object (&partition_table_block); g_clear_object (&object); g_clear_error (&loc_error); @@ -392,7 +392,7 @@ index 5fa20482..7260c00f 100644 } /* ---------------------------------------------------------------------------------------------------- */ -@@ -763,6 +774,7 @@ typedef struct +@@ -798,6 +809,7 @@ typedef struct guint64 new_size; } WaitForPartitionResizeData; @@ -400,7 +400,7 @@ index 5fa20482..7260c00f 100644 static UDisksObject * wait_for_partition_resize (UDisksDaemon *daemon, gpointer user_data) -@@ -785,6 +797,7 @@ wait_for_partition_resize (UDisksDaemon *daemon, +@@ -820,6 +832,7 @@ wait_for_partition_resize (UDisksDaemon *daemon, return object; } @@ -408,7 +408,7 @@ index 5fa20482..7260c00f 100644 /* runs in thread dedicated to handling @invocation */ static gboolean -@@ -793,6 +806,7 @@ handle_resize (UDisksPartition *partition, +@@ -828,6 +841,7 @@ handle_resize (UDisksPartition *partition, guint64 size, GVariant *options) { @@ -416,7 +416,7 @@ index 5fa20482..7260c00f 100644 UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; -@@ -891,7 +905,9 @@ handle_resize (UDisksPartition *partition, +@@ -926,7 +940,9 @@ handle_resize (UDisksPartition *partition, g_clear_object (&partition_table_block); return TRUE; /* returning TRUE means that we handled the method invocation */ @@ -427,7 +427,7 @@ index 5fa20482..7260c00f 100644 } /* ---------------------------------------------------------------------------------------------------- */ -@@ -902,6 +918,7 @@ handle_delete (UDisksPartition *partition, +@@ -937,6 +953,7 @@ handle_delete (UDisksPartition *partition, GDBusMethodInvocation *invocation, GVariant *options) { @@ -435,7 +435,7 @@ index 5fa20482..7260c00f 100644 UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; -@@ -989,6 +1006,9 @@ handle_delete (UDisksPartition *partition, +@@ -1024,6 +1041,9 @@ handle_delete (UDisksPartition *partition, g_clear_object (&object); return TRUE; /* returning TRUE means that we handled the method invocation */ @@ -489,5 +489,5 @@ index a52d4084..9cdc2368 100644 static int -- -2.17.1 +2.17.2 diff --git a/rpm/0002-Drop-smartata-dependencies.patch b/rpm/0002-Drop-smartata-dependencies.patch index 3d7d7d9..f282e2b 100644 --- a/rpm/0002-Drop-smartata-dependencies.patch +++ b/rpm/0002-Drop-smartata-dependencies.patch @@ -1,7 +1,7 @@ -From fce6c2b7904eec9fbb4be5151178bc923d509ed3 Mon Sep 17 00:00:00 2001 +From 1eefa406578f85320a7b2e0b488c914814155c34 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Thu, 7 Dec 2017 13:15:34 +0200 -Subject: [PATCH 2/8] Drop smartata dependencies +Subject: [PATCH 2/9] Drop smartata dependencies Signed-off-by: Raine Makelainen --- @@ -10,10 +10,10 @@ Signed-off-by: Raine Makelainen 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index 61972a62..8bdb5a9f 100644 +index aea49bf7..6a482e4c 100644 --- a/configure.ac +++ b/configure.ac -@@ -166,10 +166,6 @@ PKG_CHECK_MODULES(POLKIT_AGENT_1, [polkit-agent-1 >= 0.102]) +@@ -161,10 +161,6 @@ PKG_CHECK_MODULES(POLKIT_AGENT_1, [polkit-agent-1 >= 0.102]) AC_SUBST(POLKIT_AGENT_1_CFLAGS) AC_SUBST(POLKIT_AGENT_1_LIBS) @@ -118,5 +118,5 @@ index da349cd8..978b57a2 100644 /* ---------------------------------------------------------------------------------------------------- */ -- -2.17.1 +2.17.2 diff --git a/rpm/0003-Loosen-up-polkit-policies-to-work-from-another-seat.patch b/rpm/0003-Loosen-up-polkit-policies-to-work-from-another-seat.patch index a85bbed..ae91a9b 100644 --- a/rpm/0003-Loosen-up-polkit-policies-to-work-from-another-seat.patch +++ b/rpm/0003-Loosen-up-polkit-policies-to-work-from-another-seat.patch @@ -1,7 +1,7 @@ -From 43e2067c1e2df252e44b795a06773992c42be82d Mon Sep 17 00:00:00 2001 +From 71a5b663652054e81e7f6e671f257e349a0fcf4e Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Tue, 6 Feb 2018 14:01:16 +0200 -Subject: [PATCH 3/8] Loosen up polkit policies to work from another seat +Subject: [PATCH 3/9] Loosen up polkit policies to work from another seat Signed-off-by: Raine Makelainen --- @@ -112,5 +112,5 @@ index d97528d4..eaf13908 100644 -- -2.17.1 +2.17.2 diff --git a/rpm/0004-Introduce-mount-sd-service-that-is-executed-as-nemo.patch b/rpm/0004-Introduce-mount-sd-service-that-is-executed-as-nemo.patch index 46fe9cc..d53fe53 100644 --- a/rpm/0004-Introduce-mount-sd-service-that-is-executed-as-nemo.patch +++ b/rpm/0004-Introduce-mount-sd-service-that-is-executed-as-nemo.patch @@ -1,7 +1,7 @@ -From 238885252bcc61b33b04e7b2f35386cd1654216e Mon Sep 17 00:00:00 2001 +From 171d5879207b5e72c14a2b06a33dea157de01882 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Tue, 6 Feb 2018 14:08:59 +0200 -Subject: [PATCH 4/8] Introduce mount-sd service that is executed as nemo +Subject: [PATCH 4/9] Introduce mount-sd service that is executed as nemo Signed-off-by: Raine Makelainen --- @@ -12,7 +12,7 @@ Signed-off-by: Raine Makelainen create mode 100644 data/mount-sd@.service diff --git a/data/80-udisks2.rules b/data/80-udisks2.rules -index e8f7c5ee..6e042977 100644 +index a64f1cb3..e3eb74e5 100644 --- a/data/80-udisks2.rules +++ b/data/80-udisks2.rules @@ -41,6 +41,9 @@ ENV{ID_VENDOR}=="*IOMEGA*", ENV{ID_MODEL}=="*ZIP*", ENV{ID_DRIVE_FLOPPY_ZIP}="1" @@ -57,5 +57,5 @@ index 00000000..c44deebd +ExecStart=/usr/bin/udisksctl mount -b /dev/%i +ExecStop=-/usr/bin/udisksctl unmount -b /dev/%i -- -2.17.1 +2.17.2 diff --git a/rpm/0005-Add-udev-rule-for-the-sda-drives.patch b/rpm/0005-Add-udev-rule-for-the-sda-drives.patch index 4fdd326..fa299f0 100644 --- a/rpm/0005-Add-udev-rule-for-the-sda-drives.patch +++ b/rpm/0005-Add-udev-rule-for-the-sda-drives.patch @@ -1,7 +1,7 @@ -From 840148a2cc7d47cb4f14ff0bbd8203936fb41a94 Mon Sep 17 00:00:00 2001 +From 25ad885b47243abcfd5d796d8a68f29c9431c67b Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Mon, 12 Mar 2018 10:18:03 +0200 -Subject: [PATCH 5/8] Add udev rule for the sda drives +Subject: [PATCH 5/9] Add udev rule for the sda drives Signed-off-by: Raine Makelainen --- diff --git a/rpm/0006-Disable-zram-rule-for-now.patch b/rpm/0006-Disable-zram-rule-for-now.patch index 6f71c58..29d5eaa 100644 --- a/rpm/0006-Disable-zram-rule-for-now.patch +++ b/rpm/0006-Disable-zram-rule-for-now.patch @@ -1,7 +1,7 @@ -From a47bdb65dce36e359fd160a6b2612f650464d501 Mon Sep 17 00:00:00 2001 +From 40af3ef886ae4d069ded42d282033dbc4fd6fae8 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Wed, 11 Apr 2018 11:11:53 +0300 -Subject: [PATCH 6/8] Disable zram rule for now +Subject: [PATCH 6/9] Disable zram rule for now Signed-off-by: Raine Makelainen --- @@ -9,7 +9,7 @@ Signed-off-by: Raine Makelainen 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/80-udisks2.rules b/data/80-udisks2.rules -index 0bb0fe47..559ca268 100644 +index 88b3d3b9..ab0c0266 100644 --- a/data/80-udisks2.rules +++ b/data/80-udisks2.rules @@ -174,7 +174,7 @@ KERNEL=="sr*", ENV{ID_VENDOR}=="Linux", ENV{ID_MODEL}=="File-CD_Gadget*", ENV{ID @@ -22,5 +22,5 @@ index 0bb0fe47..559ca268 100644 # Explicitly ignore ram block devices, they don't work with udev KERNEL=="ram*", ENV{UDISKS_IGNORE}="1" -- -2.17.1 +2.17.2 diff --git a/rpm/0007-Create-mount-path-with-755-rights.patch b/rpm/0007-Create-mount-path-with-755-rights.patch index 9c7c864..94e6850 100644 --- a/rpm/0007-Create-mount-path-with-755-rights.patch +++ b/rpm/0007-Create-mount-path-with-755-rights.patch @@ -1,7 +1,7 @@ -From 25d40682c8393178112ca1f3e8630f90184ce84a Mon Sep 17 00:00:00 2001 +From ec9e62b03aab73427a6b290fd5140134f4526ac8 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Wed, 18 Apr 2018 18:00:00 +0300 -Subject: [PATCH 7/8] Create mount path with 755 rights +Subject: [PATCH 7/9] Create mount path with 755 rights Signed-off-by: Raine Makelainen --- @@ -22,5 +22,5 @@ index 8d1bff42..97f1d1a4 100644 if (g_mkdir (mount_dir, 0750) != 0 && errno != EEXIST) #endif -- -2.17.1 +2.17.2 diff --git a/rpm/0008-Make-it-possible-to-encrypt-mmcblk-format-with-encry.patch b/rpm/0008-Make-it-possible-to-encrypt-mmcblk-format-with-encry.patch index f7caa3c..51da8b6 100644 --- a/rpm/0008-Make-it-possible-to-encrypt-mmcblk-format-with-encry.patch +++ b/rpm/0008-Make-it-possible-to-encrypt-mmcblk-format-with-encry.patch @@ -1,7 +1,7 @@ -From 6f14b8f50eb50a20e8cd20e8fc07f7e3a03fd0b4 Mon Sep 17 00:00:00 2001 +From faf545a45093c492fbc9cc40b18e63675bcf1e89 Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Tue, 18 Sep 2018 17:04:36 +0300 -Subject: [PATCH 8/8] Make it possible to encrypt mmcblk* (format with +Subject: [PATCH 8/9] Make it possible to encrypt mmcblk* (format with encryption) Signed-off-by: Raine Makelainen @@ -10,10 +10,10 @@ Signed-off-by: Raine Makelainen 1 file changed, 5 insertions(+) diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c -index 2a8ed305..87aa924f 100644 +index e5bbc190..9eecd59c 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c -@@ -2257,8 +2257,13 @@ wait_for_luks_uuid (UDisksDaemon *daemon, +@@ -2279,8 +2279,13 @@ wait_for_luks_uuid (UDisksDaemon *daemon, if (block == NULL) goto out; @@ -28,5 +28,5 @@ index 2a8ed305..87aa924f 100644 ret = g_object_ref (data->object); -- -2.17.1 +2.17.2 diff --git a/rpm/0009-Reduce-reserved-blocks-percentage-to-zero-for-ext2-e.patch b/rpm/0009-Reduce-reserved-blocks-percentage-to-zero-for-ext2-e.patch new file mode 100644 index 0000000..9cab954 --- /dev/null +++ b/rpm/0009-Reduce-reserved-blocks-percentage-to-zero-for-ext2-e.patch @@ -0,0 +1,45 @@ +From e63cbc17f8afcc2f99c45150bbd366a8dccc5199 Mon Sep 17 00:00:00 2001 +From: Raine Makelainen +Date: Wed, 21 Nov 2018 17:27:59 +0200 +Subject: [PATCH 9/9] Reduce reserved blocks percentage to zero for + ext2/ext3/ext4 formatting + +Signed-off-by: Raine Makelainen +--- + src/udiskslinuxfsinfo.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/udiskslinuxfsinfo.c b/src/udiskslinuxfsinfo.c +index d9e9f814..ba0049cd 100644 +--- a/src/udiskslinuxfsinfo.c ++++ b/src/udiskslinuxfsinfo.c +@@ -70,7 +70,7 @@ const FSInfo _fs_info[] = + NULL, + TRUE, /* supports_online_label_rename */ + TRUE, /* supports_owners */ +- "mkfs.ext2 -F -L $LABEL $OPTIONS $DEVICE", ++ "mkfs.ext2 -m 0 -F -L $LABEL $OPTIONS $DEVICE", + "mkfs.ext2 -n -F -L $LABEL $OPTIONS $DEVICE", + "-E nodiscard", /* option_no_discard */ + }, +@@ -80,7 +80,7 @@ const FSInfo _fs_info[] = + NULL, + TRUE, /* supports_online_label_rename */ + TRUE, /* supports_owners */ +- "mkfs.ext3 -F -L $LABEL $OPTIONS $DEVICE", ++ "mkfs.ext3 -m 0 -F -L $LABEL $OPTIONS $DEVICE", + "mkfs.ext3 -n -F -L $LABEL $OPTIONS $DEVICE", + "-E nodiscard", /* option_no_discard */ + }, +@@ -90,7 +90,7 @@ const FSInfo _fs_info[] = + NULL, + TRUE, /* supports_online_label_rename */ + TRUE, /* supports_owners */ +- "mkfs.ext4 -F -L $LABEL $OPTIONS $DEVICE", ++ "mkfs.ext4 -m 0 -F -L $LABEL $OPTIONS $DEVICE", + "mkfs.ext4 -n -F -L $LABEL $OPTIONS $DEVICE", + "-E nodiscard", /* option_no_discard */ + }, +-- +2.17.2 + diff --git a/rpm/udisks2.spec b/rpm/udisks2.spec index c35ea48..d5a0450 100644 --- a/rpm/udisks2.spec +++ b/rpm/udisks2.spec @@ -22,6 +22,7 @@ Patch5: 0005-Add-udev-rule-for-the-sda-drives.patch Patch6: 0006-Disable-zram-rule-for-now.patch Patch7: 0007-Create-mount-path-with-755-rights.patch Patch8: 0008-Make-it-possible-to-encrypt-mmcblk-format-with-encry.patch +Patch9: 0009-Reduce-reserved-blocks-percentage-to-zero-for-ext2-e.patch BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} BuildRequires: pkgconfig(gobject-introspection-1.0) @@ -113,6 +114,7 @@ dynamic library, which provides access to the udisksd daemon. %patch6 -p1 -b .udev-disable-zram %patch7 -p1 -b .mount-path-rights %patch8 -p1 -b .mmcblk-encryption +%patch9 -p1 -b .mkfs-reserved-blocks-percentage %build # Disable gtk-doc