[pbs-devel] [PATCH proxmox v2] sys: open process_locker lockfile lazy

Gabriel Goller g.goller at proxmox.com
Fri Dec 1 11:15:11 CET 2023


On 11/28/23 11:04, Thomas Lamprecht wrote:
> [..]
> I never had good experience with lazy open (or lazy unmount) so I'd like
> to avoid such things if possible.
> And luckily we already have a proposed solution, one that just gathered
> a bit dust and where only bikeshedding questions where discussed anymore,
> namely the "refactor datastore locking to use tmpfs" [0] one from Stefan
> Sterz.
>
> As with that we have a few advantages:
> - no lazy opening code that needs lots of brain power to ensure it really
>    is OK
>
> - all special FS (like NFS) profit from this change too, that was even
>    the original reason for the series.
>
> - should be a bit faster to have locks in memory only
>
> - the issue with unmount goes away too
>
> The only potential disadvantage:
>
> - locks are lost over (sudden) reboots, but should not matter really as
>    we're mostly locking for concurrency, but still write data safely, i.e.,
>    to tmpfile and then rename, so the on-disk state should always be
>    consistent anyway.
>
> Maybe you can check with Stefan how the status is, and maybe take over
> his series, rebase it and see if we can get the final nits sorted out.
>
> [0]: https://lists.proxmox.com/pipermail/pbs-devel/2022-August/005414.html
That's a good idea!
We could move the process-locker lock files (currently they are in 
`/mnt/datastore{name}/.lock`)
to the tmpfs directory where all the other locks are (probably 
`/run/proxmox-backup/{name}/.lock`.

Like this we don't have to do the lazy-locking, because the file can be 
open all the time and we
can still unmount the datastore (as the lockfile is not on that mount 
anymore).

This change could also be applied without @sterzy's series.




More information about the pbs-devel mailing list