* [Qemu-devel] Don't return type from host in readdir on local 9p filesystem
@ 2014-08-22 9:22 Michael Tokarev
2014-09-03 21:39 ` Aneesh Kumar K.V
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2014-08-22 9:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Bastian Blank, Michael Tokarev, Aneesh Kumar K.V
From: Bastian Blank <waldi@debian.org>
When using mapped mode in 9pfs, readdir implementation
should not return file type in d_type from the host
readdir, instead, it should use the type stored in
the extended attributes. Since d_type is optional
and reading ext attrs for every readdir is expensive,
it should be sufficient to just set d_type to DT_UNKNOWN,
so guest will know to look it up separately.
This is a -stable material.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
--- qemu-2.0.0+dfsg.orig/hw/9pfs/virtio-9p-local.c
+++ qemu-2.0.0+dfsg/hw/9pfs/virtio-9p-local.c
@@ -396,12 +396,16 @@ static int local_readdir_r(FsContext *ct
again:
ret = readdir_r(fs->dir, entry, result);
- if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
+ if (ctx->export_flags & V9FS_SM_MAPPED) {
+ entry->d_type = DT_UNKNOWN;
+ }
+ else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
if (!ret && *result != NULL &&
!strcmp(entry->d_name, VIRTFS_META_DIR)) {
/* skp the meta data directory */
goto again;
}
+ entry->d_type = DT_UNKNOWN;
}
return ret;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Don't return type from host in readdir on local 9p filesystem
2014-08-22 9:22 [Qemu-devel] Don't return type from host in readdir on local 9p filesystem Michael Tokarev
@ 2014-09-03 21:39 ` Aneesh Kumar K.V
2014-09-04 13:24 ` Bastian Blank
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2014-09-03 21:39 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel, Bastian Blank
Michael Tokarev <mjt@tls.msk.ru> writes:
> From: Bastian Blank <waldi@debian.org>
>
> When using mapped mode in 9pfs, readdir implementation
> should not return file type in d_type from the host
> readdir, instead, it should use the type stored in
> the extended attributes. Since d_type is optional
> and reading ext attrs for every readdir is expensive,
> it should be sufficient to just set d_type to DT_UNKNOWN,
> so guest will know to look it up separately.
>
> This is a -stable material.
>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>
> --- qemu-2.0.0+dfsg.orig/hw/9pfs/virtio-9p-local.c
> +++ qemu-2.0.0+dfsg/hw/9pfs/virtio-9p-local.c
> @@ -396,12 +396,16 @@ static int local_readdir_r(FsContext *ct
>
> again:
> ret = readdir_r(fs->dir, entry, result);
> - if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
> + if (ctx->export_flags & V9FS_SM_MAPPED) {
> + entry->d_type = DT_UNKNOWN;
> + }
> + else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
> if (!ret && *result != NULL &&
> !strcmp(entry->d_name, VIRTFS_META_DIR)) {
> /* skp the meta data directory */
> goto again;
> }
> + entry->d_type = DT_UNKNOWN;
> }
> return ret;
> }
Hi Bastian,
Can I add your signed-off-by to this patch ?
-aneesh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Don't return type from host in readdir on local 9p filesystem
2014-09-03 21:39 ` Aneesh Kumar K.V
@ 2014-09-04 13:24 ` Bastian Blank
0 siblings, 0 replies; 3+ messages in thread
From: Bastian Blank @ 2014-09-04 13:24 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: Michael Tokarev, qemu-devel
On Wed, Sep 03, 2014 at 04:39:35PM -0500, Aneesh Kumar K.V wrote:
> Michael Tokarev <mjt@tls.msk.ru> writes:
> > From: Bastian Blank <waldi@debian.org>
> >
> > When using mapped mode in 9pfs, readdir implementation
> > should not return file type in d_type from the host
> > readdir, instead, it should use the type stored in
> > the extended attributes. Since d_type is optional
> > and reading ext attrs for every readdir is expensive,
> > it should be sufficient to just set d_type to DT_UNKNOWN,
> > so guest will know to look it up separately.
> >
> > This is a -stable material.
> >
> > Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Bastian Blank <waldi@debian.org>
> >
> > --- qemu-2.0.0+dfsg.orig/hw/9pfs/virtio-9p-local.c
> > +++ qemu-2.0.0+dfsg/hw/9pfs/virtio-9p-local.c
> > @@ -396,12 +396,16 @@ static int local_readdir_r(FsContext *ct
> >
> > again:
> > ret = readdir_r(fs->dir, entry, result);
> > - if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
> > + if (ctx->export_flags & V9FS_SM_MAPPED) {
> > + entry->d_type = DT_UNKNOWN;
> > + }
> > + else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) {
> > if (!ret && *result != NULL &&
> > !strcmp(entry->d_name, VIRTFS_META_DIR)) {
> > /* skp the meta data directory */
> > goto again;
> > }
> > + entry->d_type = DT_UNKNOWN;
> > }
> > return ret;
> > }
>
> Can I add your signed-off-by to this patch ?
Sure.
Bastian
--
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-04 13:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 9:22 [Qemu-devel] Don't return type from host in readdir on local 9p filesystem Michael Tokarev
2014-09-03 21:39 ` Aneesh Kumar K.V
2014-09-04 13:24 ` Bastian Blank
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.