[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5] file-posix: detect the lock using the real file
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v5] file-posix: detect the lock using the real file |
Date: |
Tue, 15 Dec 2020 10:55:16 +0000 |
User-agent: |
Mutt/1.14.6 (2020-07-11) |
On Tue, Dec 15, 2020 at 06:53:56PM +0800, Li Feng wrote:
> This patch addresses this issue:
> When accessing a volume on an NFS filesystem without supporting the file lock,
> tools, like qemu-img, will complain "Failed to lock byte 100".
>
> In the original code, the qemu_has_ofd_lock will test the lock on the
> "/dev/null" pseudo-file. Actually, the file.locking is per-drive property,
> which depends on the underlay filesystem.
>
> In this patch, add a new 'qemu_has_file_lock' to detect whether the
> file supports the file lock. And disable the lock when the underlay file
> system doesn't support locks.
>
> Signed-off-by: Li Feng <fengli@smartx.com>
> ---
> v5: simplify the code.
> v4: use the fd as the qemu_has_file_lock argument.
> v3: don't call the qemu_has_ofd_lock, use a new function instead.
> v2: remove the refactoring.
> ---
> block/file-posix.c | 61 +++++++++++++++++++++++---------------------
> include/qemu/osdep.h | 1 +
> util/osdep.c | 14 ++++++++++
> 3 files changed, 47 insertions(+), 29 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH v5] file-posix: detect the lock using the real file, Li Feng, 2020/12/15
- Re: [PATCH v5] file-posix: detect the lock using the real file,
Daniel P . Berrangé <=
- Re: [PATCH v5] file-posix: detect the lock using the real file, Vladimir Sementsov-Ogievskiy, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Daniel P . Berrangé, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Vladimir Sementsov-Ogievskiy, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Daniel P . Berrangé, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Vladimir Sementsov-Ogievskiy, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Daniel P . Berrangé, 2020/12/16
- Re: [PATCH v5] file-posix: detect the lock using the real file, Vladimir Sementsov-Ogievskiy, 2020/12/16