From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: aneesh.kumar@linux.vnet.ibm.com, armbru@redhat.com,
qemu-devel@nongnu.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
aliguori@amazon.com
Subject: Re: [Qemu-devel] [PATCH] [RESEND-try-3] hw/9pfs: fix P9_STATS_GEN handling
Date: Tue, 28 Jan 2014 13:40:59 +0200 (EET) [thread overview]
Message-ID: <20140128114059.80CDFE0090@blue.fi.intel.com> (raw)
In-Reply-To: <20140128112650.GA18171@redhat.com>
Michael S. Tsirkin wrote:
> On Tue, Jan 28, 2014 at 12:55:51PM +0200, Kirill A. Shutemov wrote:
> > Currently we have few issues with P9_STATS_GEN:
> >
> > - We don't try to read st_gen anything except files or directories, but
> > still set P9_STATS_GEN bit in st_result_mask. It may mislead client:
> > we present garbage as valid st_gen.
> >
> > - If we failed to get valid st_gen with ENOTTY, we ignore error, but
> > still set P9_STATS_GEN bit in st_result_mask.
> >
> > - If we failed to get valid st_gen with any other errno, we fail
> > getattr altogether. It's excessive: we block valid client use-cases,
> > like chdir(2) to non-readable directory with execution bit set.
> >
> > The patch fixes these issues and cleanup code a bit.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
> > Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> Would be better to split unrelated issues out to separate patches.
They are not totally unrelated: they all unbreak P9_STATS_GEN.
But yes, I can split if it needed.
> > diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> > index 8cbb8ae32a03..3e51fcd152f8 100644
> > --- a/hw/9pfs/virtio-9p.c
> > +++ b/hw/9pfs/virtio-9p.c
> > @@ -1080,10 +1080,18 @@ static void v9fs_getattr(void *opaque)
> > /* fill st_gen if requested and supported by underlying fs */
> > if (request_mask & P9_STATS_GEN) {
> > retval = v9fs_co_st_gen(pdu, &fidp->path, stbuf.st_mode, &v9stat_dotl);
> > - if (retval < 0) {
> > + switch (retval) {
> > + case 0:
> > + /* we have valid st_gen: update result mask */
> > + v9stat_dotl.st_result_mask |= P9_STATS_GEN;
> > + break;
> > + case -EINTR:
> > + /* request cancelled */
> > goto out;
>
> Shouldn't EINTR be retried?
No. It could be canceled by client (with Tflush) on purpose and client can
retry if needed.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2014-01-28 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 10:55 [Qemu-devel] [PATCH] [RESEND-try-3] hw/9pfs: fix P9_STATS_GEN handling Kirill A. Shutemov
2014-01-28 11:15 ` Paolo Bonzini
2014-01-28 12:31 ` Aneesh Kumar K.V
2014-01-28 11:26 ` Michael S. Tsirkin
2014-01-28 11:40 ` Kirill A. Shutemov [this message]
2014-01-28 12:09 ` Michael S. Tsirkin
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=20140128114059.80CDFE0090@blue.fi.intel.com \
--to=kirill.shutemov@linux.intel.com \
--cc=aliguori@amazon.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--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.