From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPX1f-0008Dk-GY for qemu-devel@nongnu.org; Thu, 04 Sep 2014 09:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPX1a-0007VO-G2 for qemu-devel@nongnu.org; Thu, 04 Sep 2014 09:24:35 -0400 Received: from moeglingen.blank.eu.org ([82.139.201.30]:34217 helo=mail.waldi.eu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPX1a-0007UW-5q for qemu-devel@nongnu.org; Thu, 04 Sep 2014 09:24:30 -0400 Date: Thu, 4 Sep 2014 13:24:20 +0000 From: Bastian Blank Message-ID: <20140904132419.GA8574@shell.waldi.eu.org> References: <1408699341-6126-1-git-send-email-mjt@msgid.tls.msk.ru> <87sik8e63s.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87sik8e63s.fsf@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] Don't return type from host in readdir on local 9p filesystem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: Michael Tokarev , qemu-devel@nongnu.org On Wed, Sep 03, 2014 at 04:39:35PM -0500, Aneesh Kumar K.V wrote: > Michael Tokarev writes: > > From: Bastian Blank > > > > 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 Signed-off-by: Bastian Blank > > > > --- 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 --