public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup] tools/process_locker: Decrement writer count in drop handler
Date: Fri, 18 Dec 2020 07:15:34 +0100 (CET)	[thread overview]
Message-ID: <700659272.1972.1608272135383@webmail.proxmox.com> (raw)
In-Reply-To: <20201217143331.2407-1-d.csapak@proxmox.com>

applied

> On 12/17/2020 3:33 PM Dominik Csapak <d.csapak@proxmox.com> wrote:
> 
>  
> of ProcessLockSharedGuard.
> 
> We use a counter to determine if we can unlock the file again, but
> we never actually decremented the writer count, so we held the
> lock forever.
> 
> This fixes the issue that we could not start a garbage collect after
> a reload, as long as the old process is still running, even when that
> process has no active backup anymore but another long running task
> (e.g. file download, terminal, etc.).
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/tools/process_locker.rs | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/tools/process_locker.rs b/src/tools/process_locker.rs
> index 56f8c514..6ab2e1c1 100644
> --- a/src/tools/process_locker.rs
> +++ b/src/tools/process_locker.rs
> @@ -55,7 +55,9 @@ impl  Drop for ProcessLockSharedGuard {
>              if let Err(err) = nix::fcntl::fcntl(data.file.as_raw_fd(), nix::fcntl::FcntlArg::F_SETLKW(&op)) {
>                  panic!("unable to drop writer lock - {}", err);
>              }
> -            data.writers = 0;
> +        }
> +        if data.writers > 0 {
> +            data.writers -= 1;
>          }
>      }
>  }
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel




      reply	other threads:[~2020-12-18  6:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:33 [pbs-devel] " Dominik Csapak
2020-12-18  6:15 ` Dietmar Maurer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=700659272.1972.1608272135383@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal