From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPIHU-00007v-4Y for qemu-devel@nongnu.org; Wed, 03 Sep 2014 17:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPIHM-0001zA-7k for qemu-devel@nongnu.org; Wed, 03 Sep 2014 17:39:55 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:53280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPIHL-0001ss-Lr for qemu-devel@nongnu.org; Wed, 03 Sep 2014 17:39:48 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Sep 2014 03:09:43 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id B84683940043 for ; Thu, 4 Sep 2014 03:09:41 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s83Lg3FT49741960 for ; Thu, 4 Sep 2014 03:12:03 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s83Ldebk023269 for ; Thu, 4 Sep 2014 03:09:41 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1408699341-6126-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1408699341-6126-1-git-send-email-mjt@msgid.tls.msk.ru> Date: Wed, 03 Sep 2014 16:39:35 -0500 Message-ID: <87sik8e63s.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain 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: Michael Tokarev , qemu-devel@nongnu.org, Bastian Blank 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 > > --- 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