From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9zyd-000373-C3 for qemu-devel@nongnu.org; Sun, 02 Feb 2014 11:33:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9zv2-0001xL-9e for qemu-devel@nongnu.org; Sun, 02 Feb 2014 11:32:59 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:37542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9zv1-0001x7-HN for qemu-devel@nongnu.org; Sun, 02 Feb 2014 11:29:16 -0500 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Feb 2014 02:29:10 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 6C9E42CE8054 for ; Mon, 3 Feb 2014 03:29:07 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s12G9o4G4981016 for ; Mon, 3 Feb 2014 03:09:50 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s12GT6dU010144 for ; Mon, 3 Feb 2014 03:29:06 +1100 From: "Aneesh Kumar K.V" In-Reply-To: <1390921707-15109-3-git-send-email-kirill.shutemov@linux.intel.com> References: <1390921707-15109-1-git-send-email-kirill.shutemov@linux.intel.com> <1390921707-15109-3-git-send-email-kirill.shutemov@linux.intel.com> Date: Sun, 02 Feb 2014 21:58:55 +0530 Message-ID: <87eh3l4gxk.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/4] hw/9pfs: make get_st_gen() return ENOTTY error on special files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" , qemu-devel@nongnu.org, aliguori@amazon.com, mst@redhat.com Cc: armbru@redhat.com "Kirill A. Shutemov" writes: > Currently we silently ignore getversion requests for anything except > file or directory. Let's instead return ENOTTY error to indicate that > getversion is not supported. It makes implementation consistent on > all not-supported cases. > > Signed-off-by: Kirill A. Shutemov Reviewed-by: Aneesh Kumar K.V > --- > hw/9pfs/virtio-9p-handle.c | 3 ++- > hw/9pfs/virtio-9p-local.c | 3 ++- > hw/9pfs/virtio-9p-proxy.c | 3 ++- > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c > index ed8c126e1d6c..17002a3d2867 100644 > --- a/hw/9pfs/virtio-9p-handle.c > +++ b/hw/9pfs/virtio-9p-handle.c > @@ -591,7 +591,8 @@ static int handle_ioc_getversion(FsContext *ctx, V9fsPath *path, > * We can get fd for regular files and directories only > */ > if (!S_ISREG(st_mode) && !S_ISDIR(st_mode)) { > - return 0; > + errno = ENOTTY; > + return -1; > } > err = handle_open(ctx, path, O_RDONLY, &fid_open); > if (err < 0) { > diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c > index 9be8854e9148..df0dbffa7ac4 100644 > --- a/hw/9pfs/virtio-9p-local.c > +++ b/hw/9pfs/virtio-9p-local.c > @@ -1077,7 +1077,8 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, > * We can get fd for regular files and directories only > */ > if (!S_ISREG(st_mode) && !S_ISDIR(st_mode)) { > - return 0; > + errno = ENOTTY; > + return -1; > } > err = local_open(ctx, path, O_RDONLY, &fid_open); > if (err < 0) { > diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c > index 5f44bb758b35..b57966d9d883 100644 > --- a/hw/9pfs/virtio-9p-proxy.c > +++ b/hw/9pfs/virtio-9p-proxy.c > @@ -1086,7 +1086,8 @@ static int proxy_ioc_getversion(FsContext *fs_ctx, V9fsPath *path, > * we can get fd for regular files and directories only > */ > if (!S_ISREG(st_mode) && !S_ISDIR(st_mode)) { > - return 0; > + errno = ENOTTY; > + return -1; > } > err = v9fs_request(fs_ctx->private, T_GETVERSION, st_gen, "s", path); > if (err < 0) { > -- > 1.8.5.2