diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-11-14 16:52:03 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-01-23 16:41:36 +0000 |
commit | 5fe319a7b19c9c328e6e061bffcf1ff6cc8b89ce (patch) | |
tree | 258008123741e2d70ad0e23185b8c04b6720df31 /python/qemu/machine.py | |
parent | 73b4d19dfc4248a74c1f3e511cfa934681d9c602 (diff) | |
download | qemu-5fe319a7b19c9c328e6e061bffcf1ff6cc8b89ce.zip qemu-5fe319a7b19c9c328e6e061bffcf1ff6cc8b89ce.tar.gz qemu-5fe319a7b19c9c328e6e061bffcf1ff6cc8b89ce.tar.bz2 |
virtiofsd: passthrough_ll: add fallback for racy ops
We have two operations that cannot be done race-free on a symlink in
certain cases: utimes and link.
Add racy fallback for these if the race-free method doesn't work. We do
our best to avoid races even in this case:
- get absolute path by reading /proc/self/fd/NN symlink
- lookup parent directory: after this we are safe against renames in
ancestors
- lookup name in parent directory, and verify that we got to the original
inode, if not retry the whole thing
Both utimes(2) and link(2) hold i_lock on the inode across the operation,
so a racing rename/delete by this fuse instance is not possible, only from
other entities changing the filesystem.
If the "norace" option is given, then disable the racy fallbacks.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'python/qemu/machine.py')
0 files changed, 0 insertions, 0 deletions