Bug#882380: initramfs-tools: Update-initramfs can take an unnecessarily long time if other disk activity is ongoing

2018-06-21 Thread Colin Watson
On Wed, Nov 22, 2017 at 01:05:00AM +0200, Jukka Tastula wrote:
> After generating an initrd update-initramfs calls sync unconditinally. This
> can take a very long time to return if other disk activity, like perhaps a
> long backup job, is running simultaneously. Suggest only syncing the 
> filesystem the initrd is actually placed on instead.

I think this is a good idea, and it would also avoid upgrade problems
such as
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1667512
in the case of things like stuck NFS mounts.

To avoid backport surprises, I would suggest adding a dependency on
coreutils (>= 8.24), which introduced the feature of sync(1) being used
here.

I've put all this in a merge request:

  https://salsa.debian.org/kernel-team/initramfs-tools/merge_requests/6

-- 
Colin Watson   [cjwat...@debian.org]



Bug#882380: initramfs-tools: Update-initramfs can take an unnecessarily long time if other disk activity is ongoing

2017-11-21 Thread Jukka Tastula
Package: initramfs-tools
Version: 0.130
Severity: wishlist
Tags: patch

Hi. 

After generating an initrd update-initramfs calls sync unconditinally. This
can take a very long time to return if other disk activity, like perhaps a
long backup job, is running simultaneously. Suggest only syncing the 
filesystem the initrd is actually placed on instead.



-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.12.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages initramfs-tools depends on:
ii  initramfs-tools-core  0.130
ii  linux-base4.5

initramfs-tools recommends no packages.

Versions of packages initramfs-tools suggests:
ii  bash-completion  1:2.1-4.3

-- no debconf information

*** /home/pollo/ir.diff
--- update-initramfs~   2017-03-07 00:42:55.0 +0200
+++ update-initramfs2017-11-22 00:16:29.149530813 +0200
@@ -158,7 +158,7 @@
mv -f "${initramfs}.new" "${initramfs}"
set_sha1
# Guard against an unclean shutdown
-   sync
+   sync -f "${initramfs}"
else
mkinitramfs_return="$?"
remove_initramfs_bak