From a0439dabb7ba27d02cede31ba5fb11b51ac7ab69 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Tue, 13 Jun 2023 15:00:56 +0200 Subject: [PATCH] - improved waiting for btrfs quota rescan (see bsc #1211459) --- LIBVERSION | 2 +- package/snapper.changes | 1 + snapper/BtrfsUtils.cc | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/LIBVERSION b/LIBVERSION index 66ce77b7..9fe9ff9d 100644 --- a/LIBVERSION +++ b/LIBVERSION @@ -1 +1 @@ -7.0.0 +7.0.1 diff --git a/package/snapper.changes b/package/snapper.changes index 5257eb52..6ba7979d 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -2,6 +2,7 @@ Tue Jun 13 12:08:55 CEST 2023 - aschnell@suse.com - update qgroup in config info in snapperd when running setup-quota +- improved waiting for btrfs quota rescan (see bsc #1211459) ------------------------------------------------------------------- Fri Apr 21 09:47:57 CEST 2023 - aschnell@suse.com diff --git a/snapper/BtrfsUtils.cc b/snapper/BtrfsUtils.cc index 9d539ad5..dc055165 100644 --- a/snapper/BtrfsUtils.cc +++ b/snapper/BtrfsUtils.cc @@ -451,17 +451,18 @@ namespace snapper struct btrfs_ioctl_quota_rescan_args args; memset(&args, 0, sizeof(args)); - for (int i = 0;; ++i) + while (true) { if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN, &args) == 0) break; if (errno == EINPROGRESS) { - if (i == 0) - y2war("waiting for old quota rescan to finish"); + y2war("waiting for old quota rescan to finish"); + + if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN_WAIT, &args) < 0) + throw runtime_error_with_errno("ioctl(BTRFS_IOC_QUOTA_WAIT_RESCAN) failed", errno); - sleep(1); continue; } -- 2.47.3