Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8833619imu; Sat, 29 Dec 2018 04:51:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN46eteixi9l3awRtRPfYFW4FzbbuKO6ITdBhkmQoYX8BHqwAQ5P+mimQx6YodiQqSkyEhnD X-Received: by 2002:a65:6148:: with SMTP id o8mr1518971pgv.451.1546087918159; Sat, 29 Dec 2018 04:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546087918; cv=none; d=google.com; s=arc-20160816; b=IpaYEV6Sf/oogqUySyTN5ACFL/Zi28fWJ70A1tSjj/YX+e3jPZCvkBw8++sIlxK544 5n+6NAfhtuNDjQWYlTqA+R3KWXlrkWbTVq0UbOyiSQ8qyKO2SDPvVUetbFM9O3EyH2h6 8JFAawsVDd0i6Q3+UMHdE3kFdpoagU7rGcSGfImD4/epE1r8vlxo66AFsJpNj+RHkY13 pmDE2XqDjpWiT2dM+YUXRwiqkvrSZaTY8rrlzKpXp3BsXnLwjdRp1lEh38Z+JubGtpXR bua1Yu3GUVKzKv7nEK0ZK2OI1L7YfwN3P1ln4WBsbG6nfjqKZcVV2DDP8NRdIhzOyVma /dng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:to:from:date; bh=pIIrVOxYOlbOQGcxd4nHrgCYtj3xuCGnxhW9l0bDewE=; b=WSCZS0ISdKmD9mFIH35fNUOn4yGEzSW2HmTSzcMu7ijdeOgM6AradoK5zKnWtknJFJ zVWcIJmnSpFN9AVOs72CvH8Bz9OjeYYOGCbUTfUW80WB4aaXZmL+U8G5NcVXDKPoZ+SB s3K2AcFhCf7WNx6QeaySNauPwxnlptc37/VGAW6aS1+8haGqzEY7tNJ8N8OpoQgOnomf m3xOIl/d+vtfLcHxguFo6mU0xNjfffAZS2wHVsSmVTiRI+o9Is9Oau2vk5Rg10Z2qv83 lFOe5hom67EKCapnO8mCO9GY/I8bkKjn7HtIh85bc6km7La3p2QNLrrUYlPU9GmIZxLO BK5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j91si42138081pld.395.2018.12.29.04.51.43; Sat, 29 Dec 2018 04:51:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbeL2EXe (ORCPT + 99 others); Fri, 28 Dec 2018 23:23:34 -0500 Received: from nautica.notk.org ([91.121.71.147]:38046 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbeL2EXe (ORCPT ); Fri, 28 Dec 2018 23:23:34 -0500 Received: by nautica.notk.org (Postfix, from userid 1001) id F2BCEC009; Sat, 29 Dec 2018 05:04:28 +0100 (CET) Date: Sat, 29 Dec 2018 05:04:13 +0100 From: Dominique Martinet To: "Theodore Y. Ts'o" , Peter Maydell , Andreas Dilger , Florian Weimer , linux-fsdevel , Linux API , Ext4 Developers List , lucho@ionkov.net, libc-alpha@sourceware.org, Arnd Bergmann , ericvh@gmail.com, hpa@zytor.com, lkml - Kernel Mailing List , QEMU Developers , rminnich@sandia.gov, v9fs-developer@lists.sourceforge.net Subject: Re: [V9fs-developer] [Qemu-devel] d_off field in struct dirent and 32-on-64 emulation Message-ID: <20181229040413.GA18900@nautica> Mail-Followup-To: "Theodore Y. Ts'o" , Peter Maydell , Andreas Dilger , Florian Weimer , linux-fsdevel , Linux API , Ext4 Developers List , lucho@ionkov.net, libc-alpha@sourceware.org, Arnd Bergmann , ericvh@gmail.com, hpa@zytor.com, lkml - Kernel Mailing List , QEMU Developers , rminnich@sandia.gov, v9fs-developer@lists.sourceforge.net References: <87bm56vqg4.fsf@mid.deneb.enyo.de> <9C6A7D45-CF53-4C61-B5DD-12CA0D419972@dilger.ca> <20181229021157.GG5864@mit.edu> <20181229023721.GA9291@nautica> <20181229031416.GH5864@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181229031416.GH5864@mit.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Theodore Y. Ts'o wrote on Fri, Dec 28, 2018: > On Sat, Dec 29, 2018 at 03:37:21AM +0100, Dominique Martinet wrote: > > > Are there going to be cases where a process or a thread will sometimes > > > want the 64-bit interface, and sometimes want the 32-bit interface? > > > Or is it always going to be one or the other? I wonder if we could > > > simply add a new flag to the process personality(2) flags. > > > > That would likely work for qemu user, but the qemu system+9p case is > > going to be more painful.. > > More precisely, the 9p protocol does not plan for anything other than > > 64bit offset so if the vfs needs to hand out a 32bit offset we'll need > > to make a correspondance table between the 32bit offsets we hand off and > > the 64bit ones to use; unless some flag can be passed at lopen to tell > > the server to always hand out 32bit offsets for this directory... And if > > we do that then 9p servers will need a way to use both APIs in parallel > > for both types of directories. > > How about if we add a fcntl(2) mediated flag, which is tied to a > struct file? Would that be more or less painful for 9p and qemu > system+9p? Hmm. 9P2000.L doesn't have anything akin to fcntl either, the only two obvious places where we could pass a flag is lopen (which already handles a bunch of linux-specific flags, e.g. passing O_LARGEFILE O_NOATIME etc will just forward these through for qemu/diod at least), or adding a new parameter to the 9p readdir. The former would let us get away without modifying the protocol as servers will just ignore flags they don't handle on implementations I checked, so it'd definitely be the least effort choice from what I can tell. On the other hand a fcntl would solve the server-side problem, it'd allow the server to request appropriately-sized offsets per fd, so it's a good start; we "just" need to figure how to translate that on the wire. -- Dominique Martinet | Asmadeus