Hello community,

here is the log from the commit of package alsa-utils for openSUSE:Factory 
checked in at 2020-12-15 12:30:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/alsa-utils (Old)
 and      /work/SRC/openSUSE:Factory/.alsa-utils.new.2328 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "alsa-utils"

Tue Dec 15 12:30:16 2020 rev:128 rq:855588 version:1.2.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/alsa-utils/alsa-utils.changes    2020-10-22 
14:23:38.630823589 +0200
+++ /work/SRC/openSUSE:Factory/.alsa-utils.new.2328/alsa-utils.changes  
2020-12-15 12:32:37.728108810 +0100
@@ -1,0 +2,10 @@
+Fri Dec 11 23:52:24 CET 2020 - ti...@suse.de
+
+- Fix alsactl restore behavior during locking (boo#1179904):
+  0010-alsactl-Fix-double-decrease-of-lock-timeout.patch
+  0011-alsactl-Fix-race-at-creating-a-lock-file.patch
+- Remove unnecessary condition for alsa-restore.service
+  0012-alsactl-Remove-asound.state-file-check-from-alsa-res.patch
+- Fix dependency in sound-extra.service
+
+-------------------------------------------------------------------

New:
----
  0010-alsactl-Fix-double-decrease-of-lock-timeout.patch
  0011-alsactl-Fix-race-at-creating-a-lock-file.patch
  0012-alsactl-Remove-asound.state-file-check-from-alsa-res.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ alsa-utils.spec ++++++
--- /var/tmp/diff_new_pack.LPXoSc/_old  2020-12-15 12:32:38.372109328 +0100
+++ /var/tmp/diff_new_pack.LPXoSc/_new  2020-12-15 12:32:38.376109332 +0100
@@ -29,6 +29,9 @@
 Source1:        01beep.conf
 Source2:        sound-extra.service
 Source5:        load-sound-modules.sh
+Patch10:        0010-alsactl-Fix-double-decrease-of-lock-timeout.patch
+Patch11:        0011-alsactl-Fix-race-at-creating-a-lock-file.patch
+Patch12:        0012-alsactl-Remove-asound.state-file-check-from-alsa-res.patch
 Patch101:       alsa-utils-configure-version-revert.patch
 BuildRequires:  alsa-devel
 %ifarch %ix86 x86_64 %arm aarch64 ppc64le riscv64
@@ -71,6 +74,9 @@
 
 %prep
 %setup -q
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
 %if 0%{?do_autoreconf}
 %patch101 -p1
 # fix stupid automake's automatic action

++++++ 0010-alsactl-Fix-double-decrease-of-lock-timeout.patch ++++++
From 878e1a7c0f03233530e7675ae015aced069c971d Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Fri, 11 Dec 2020 23:41:59 +0100
Subject: [PATCH] alsactl: Fix double decrease of lock timeout

The state_lock() has a loop to wait for the lock file creation, and
the timeout value gets decremented twice mistakenly, which leads to a
half timeout (5 seconds) than expected 10 seconds.  Fix it.

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 alsactl/lock.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/alsactl/lock.c b/alsactl/lock.c
index 4a485392b3bd..05f6e4d2a102 100644
--- a/alsactl/lock.c
+++ b/alsactl/lock.c
@@ -63,7 +63,6 @@ static int state_lock_(const char *file, int lock, int 
timeout, int _fd)
                        if (fd < 0) {
                                if (errno == EBUSY || errno == EAGAIN) {
                                        sleep(1);
-                                       timeout--;
                                } else {
                                        err = -errno;
                                        goto out;
-- 
2.26.2

++++++ 0011-alsactl-Fix-race-at-creating-a-lock-file.patch ++++++
From c53f7cd03881092d5a61505d23ab8f920b7faf12 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Fri, 11 Dec 2020 23:46:23 +0100
Subject: [PATCH] alsactl: Fix race at creating a lock file

A race at creating a lock file in state_lock() was discovered
recently: namely, between the first open(O_RDWR) and the second
open(O_RDWR|O_CREAT|O_EXCL) calls, another alsactl invocation may
already create a lock file, then the second open() will return EEXIST,
which isn't handled properly and treated as a fatal error.

In this patch, we check EEXIST case and try again open() with O_RDWR.
This must succeed usually, and if it fails, handle finally as the
fatal error.

BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1179904
Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 alsactl/lock.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/alsactl/lock.c b/alsactl/lock.c
index 05f6e4d2a102..5b4746231996 100644
--- a/alsactl/lock.c
+++ b/alsactl/lock.c
@@ -63,10 +63,15 @@ static int state_lock_(const char *file, int lock, int 
timeout, int _fd)
                        if (fd < 0) {
                                if (errno == EBUSY || errno == EAGAIN) {
                                        sleep(1);
-                               } else {
-                                       err = -errno;
-                                       goto out;
+                                       continue;
                                }
+                               if (errno == EEXIST) {
+                                       fd = open(nfile, O_RDWR);
+                                       if (fd >= 0)
+                                               break;
+                               }
+                               err = -errno;
+                               goto out;
                        }
                }
        }
-- 
2.26.2

++++++ 0012-alsactl-Remove-asound.state-file-check-from-alsa-res.patch ++++++
From 12487b40b6e7230a003eb6e4333ee820d8578592 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Fri, 11 Dec 2020 23:55:34 +0100
Subject: [PATCH ] alsactl: Remove asound.state file check from 
alsa-restore.service again

We added the check of asound.state file presence some time ago to
assure that alsactl gets called only if the state file is already
present.  Since then, the situation has changed significantly:
e.g. now alsactl does initialize if the state file isn't present, and
the same alsa-restore.service is used to save the state.  This means
that we should start this service no matter the state file exists at
the boot time or not.  So, revert the old change again.

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 alsactl/alsa-restore.service.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
index a84c2e842444..80fd5fd48203 100644
--- a/alsactl/alsa-restore.service.in
+++ b/alsactl/alsa-restore.service.in
@@ -7,7 +7,6 @@
 Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
 ConditionPathExistsGlob=/dev/snd/control*
-ConditionPathExists=@asoundrcfile@
 
 [Service]
 Type=oneshot
-- 
2.26.2

++++++ sound-extra.service ++++++
--- /var/tmp/diff_new_pack.LPXoSc/_old  2020-12-15 12:32:38.472109409 +0100
+++ /var/tmp/diff_new_pack.LPXoSc/_new  2020-12-15 12:32:38.472109409 +0100
@@ -1,6 +1,6 @@
 [Unit]
 Description=Load extra kernel modules for sound stuff
-After=alsasound.service
+After=alsa-restore.service
 ConditionPathExists=/proc/asound
 
 [Service]
_______________________________________________
openSUSE Commits mailing list -- commit@lists.opensuse.org
To unsubscribe, email commit-le...@lists.opensuse.org
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/commit@lists.opensuse.org

Reply via email to