From patchwork Fri May 10 17:53:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel de Perthuis X-Patchwork-Id: 243052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D2C2D2C00D8 for ; Sat, 11 May 2013 03:54:05 +1000 (EST) Received: from localhost ([::1]:58635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UarW8-0003oz-5C for incoming@patchwork.ozlabs.org; Fri, 10 May 2013 13:54:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UarVh-0003bi-GT for qemu-devel@nongnu.org; Fri, 10 May 2013 13:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UarVd-000745-C0 for qemu-devel@nongnu.org; Fri, 10 May 2013 13:53:37 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:63166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UarVd-00073k-4t; Fri, 10 May 2013 13:53:33 -0400 Received: by mail-we0-f174.google.com with SMTP id x53so4218739wes.5 for ; Fri, 10 May 2013 10:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding; bh=+Bzh6eJ/dviIgRZTc7VwO5sCSASG9Xxw/47nkUI0338=; b=K5sLiAAtkJIdjARmUAcWkipROcqTBkndtLxXueXQRtBz2EywOG6vBdLM5dUD6G8e/g rz5NUZMTQOHiTjvB1drcXX7Hn3Q0He07/85nlqgx7u5Jm/jXIkkfiaVSMusHDpDlT5HQ S5aLYqPO3qLypTUeU/MxgqwTNqbH3UqUIaxgdQUl1+HmrMVahc6DEqa64LnYFXogqSrU zfv0jdaxQ0V+iqve408H5XqhJkLH5wpHGBkhCfZ7yONJjc4pG08zrFXfnc78g4FQ7+b8 Ur99R3VWczOCol0YeVo8NO9RFDI7TPMkk7oDGAkMDbRjeyTdT2yH3lBvUH8rbP9dhmpN 5Pyg== X-Received: by 10.180.37.109 with SMTP id x13mr5395642wij.20.1368208412298; Fri, 10 May 2013 10:53:32 -0700 (PDT) Received: from ?IPv6:2a01:e35:8a2c:b230:5141:11ae:22b0:e06e? ([2a01:e35:8a2c:b230:5141:11ae:22b0:e06e]) by mx.google.com with ESMTPSA id x13sm5437871wib.3.2013.05.10.10.53.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 May 2013 10:53:31 -0700 (PDT) Message-ID: <518D3418.7050402@gmail.com> Date: Fri, 10 May 2013 19:53:28 +0200 From: Gabriel de Perthuis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Aneesh Kumar K.V" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22e Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] 9p: Be robust against paths without FS_IOC_GETVERSION X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 9P optionally uses the FS_IOC_GETVERSION ioctl to get information about a file's version (sometimes called generation number). The code checks for supported filesystems at mount time, but some paths may come from other mounted filesystems. Change it to treat unsupported paths the same as unsupported filesystems, returning 0 in both cases. Note: ENOTTY is the error code for an unsupported ioctl. This fix allows booting a linux kernel with the same / filesystem as the host; otherwise the boot fails when mounting devtmpfs. Signed-off-by: Gabriel de Perthuis Reviewed-by: Aneesh Kumar K.V --- Here it is with an expanded commit message. hw/9pfs/cofile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 2efebf3..194c130 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -36,10 +36,14 @@ int v9fs_co_st_gen(V9fsPDU *pdu, V9fsPath *path, mode_t st_mode, err = -errno; } }); v9fs_path_unlock(s); } + /* The ioctl may not be supported depending on the path */ + if (err == -ENOTTY) { + err = 0; + } return err; } int v9fs_co_lstat(V9fsPDU *pdu, V9fsPath *path, struct stat *stbuf) {