From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Li Feng <fengli@smartx.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
lifeng1519@gmail.com, "open list:raw" <qemu-block@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
Max Reitz <mreitz@redhat.com>,
kyle@smartx.com
Subject: Re: [PATCH v5] file-posix: detect the lock using the real file
Date: Tue, 15 Dec 2020 10:55:16 +0000 [thread overview]
Message-ID: <20201215105516.GI121272@redhat.com> (raw)
In-Reply-To: <1608029636-31442-1-git-send-email-fengli@smartx.com>
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 :|
next prev parent reply other threads:[~2020-12-15 10:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 10:53 [PATCH v5] file-posix: detect the lock using the real file Li Feng
2020-12-15 10:55 ` Daniel P. Berrangé [this message]
2020-12-16 8:22 ` Vladimir Sementsov-Ogievskiy
2020-12-16 9:49 ` Daniel P. Berrangé
2020-12-16 10:25 ` Vladimir Sementsov-Ogievskiy
2020-12-16 10:41 ` Daniel P. Berrangé
2020-12-16 12:03 ` Vladimir Sementsov-Ogievskiy
2020-12-16 12:57 ` Daniel P. Berrangé
2020-12-16 13:22 ` Vladimir Sementsov-Ogievskiy
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=20201215105516.GI121272@redhat.com \
--to=berrange@redhat.com \
--cc=fengli@smartx.com \
--cc=kwolf@redhat.com \
--cc=kyle@smartx.com \
--cc=lifeng1519@gmail.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.