qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Don't return type from host in readdir on local 9p file


From: Aneesh Kumar K.V
Subject: Re: [Qemu-devel] Don't return type from host in readdir on local 9p filesystem
Date: Wed, 03 Sep 2014 16:39:35 -0500
User-agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.91.1 (x86_64-unknown-linux-gnu)

Michael Tokarev <address@hidden> writes:

> From: Bastian Blank <address@hidden>
>
> 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 <address@hidden>
>
> --- 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]