Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2282867lqb; Mon, 27 May 2024 14:25:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUH9zP5S0AbPnFo7LYDFN1s8xfY/Fes7wvZa+yrMi+YJlR1GgA8aC/FsXcDw9zYAFMl1X/iZtoB52dn1z4po9vAy3yA56/gWM9B0fG3cA== X-Google-Smtp-Source: AGHT+IF9eWPBzUzbVNZlF9NLnNjPL0Oa7pwBtp0YJsDEwDcF535GfBmTK02GfIHpNz4zLt7YJCW9 X-Received: by 2002:a05:6a20:12d1:b0:1a7:aabc:24ae with SMTP id adf61e73a8af0-1b212d2a4f9mr11354770637.18.1716845147715; Mon, 27 May 2024 14:25:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716845147; cv=pass; d=google.com; s=arc-20160816; b=z8eZxUgmTw779j7Y1UsMAWVeUEaank/Lu06ZcMc4C+JzfOtpnc7F+Lm9pzQ//BSEeG LGoVuWj0f1N9Huw8wNyevzACkyMV6wh0v0u0KwMheHBX1/SNywFHviZyyNhqEQltX631 zUmWIySyDZlwFRENlyV/IYClpRmndUSojznpbY7FqDQeU/kEHtnz2Wip4A1sJz3Xl0V/ vKd/HzUZRKGLxTRKrtbB1qbad+csV20u1n/uvTYxy2Zl+P1Raze8bU89zZA8pddnSESV +NbKmaUdAPcUM118qrHD5CgqCcI5ca91Eoyvsagv8Go9cpVQbavF4O/pdKEayn+elljI TJ1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PKe5sDmdxLVMDi1TLTY8eblrDmzTLWLqc3P92QWHeGI=; fh=0pKsvf8bBxXhEasRfJmln7XUd20FozZ/WBQHvrfbbPk=; b=sIRMWC+cRULMfOAQmyTPfi58m+IgkqzI2KqK0wL1u//Fg3DejJlANtTucbO6O1Snp0 LBnl7oeaH1c5W1QAwXsx7TgsQa5H7utlwIHj1WJOaWulkYU2PaAOUKthQOphFxUbjxI5 oAE8ncZQQxyVmgj7aWXf51xU+0U1TzZ0N4iJs/GoAxSjLHN3YXKt3UogG/yVdSv/OqYb 5hF0cBDXNcC0YjlQycPLbxci2xj07V90ddRy6SrADwsWfm9Sx3u6n9H2xHo7GCvnogoO YUzVas5qpcZCHYOdgQ/pTsUg8IZgenfc1xtmHm8ZyyeNPyPSONULAQ88/MMroZCijgW6 ZEzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=h6ef4tVo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-191232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191232-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822a6aee6asi7214972a12.738.2024.05.27.14.25.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:25:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=h6ef4tVo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-191232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191232-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3FC1F291C4C for ; Mon, 27 May 2024 16:27:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DD0813A25E; Mon, 27 May 2024 16:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="h6ef4tVo" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8C317E901; Mon, 27 May 2024 16:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827045; cv=none; b=sbi/IJ6UoKe6ZITU3wU0RswpRlE0i4imib0X/8EdicfR746ElspEY4MyoOIgOqrIdykrcR4V1Xea3/BmhMYBd4KgwNGwRTMK4lHoFjEA69s5fEW9fFgeIS0k6w4BmSPGcd7cgD7IoNBBKGZj/pjgvA4po/6UDHqzo5zTzLFA1i0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827045; c=relaxed/simple; bh=zT3lpBZ+2fnJDWLc3sht5+aKTyNn+eXHeZ2ka4QD1CY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hAlbtj1+d0vLs5MaYE9Lm1MlMPE1X7JGFxhZhkpyZpL8/wQNwhocHWRrLhz+ba1d4UbkPeWyW8rayPRQiPrQJeGovZD0wRxky75ICIQ8bkJ95PqdyNFz5RXF9jFQ5Omwawi91vgqOwMCuwlb8eeu3FTg0LFNgh0dCfCSXdacTSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=h6ef4tVo; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PKe5sDmdxLVMDi1TLTY8eblrDmzTLWLqc3P92QWHeGI=; b=h6ef4tVo/DR8bnv4zxe8tJP+Kg sGdSQTmCmQRGTyRKl3IIFSHOUB+8lQhu/a2sKyB+KIrzL8UQ+q8HBD0j/bKbQcATF4KHQAH46QzdX BLF3x5fIgqt0kUmyPmz29QMVk6gIyNIgxBirCsMCtSMZmrUt/dJrzGz6a1D74sFbUWUr+7mB071+l RkmdI5jgDuQoTi9+fcxo11XTm1QWoQuybTXR5WCsac5OscIn9P+d/WPj5qiO2UhB7apymQG+9bWRB MkeUiqREiWGl/ST5NBc88wnCmJs6pmHFlfufdriBmB1X7tGo5SY9wwu+NdueSWqSQ5KVnZnJpvxpq QPKFrWLQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBd8k-0000000Fpmc-09dI; Mon, 27 May 2024 16:24:02 +0000 Date: Mon, 27 May 2024 09:24:02 -0700 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Aleksa Sarai , Alexander Viro , Christian Brauner , Chuck Lever , Jeff Layton , Amir Goldstein , Alexander Aring , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH RFC v2] fhandle: expose u64 mount id to name_to_handle_at(2) Message-ID: References: <20240523-exportfs-u64-mount-id-v2-1-f9f959f17eb1@cyphar.com> <20240526.184753-detached.length.shallow.contents-jWkMukeD7VAC@cyphar.com> <20240527133430.ifjo2kksoehtuwrn@quack3> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527133430.ifjo2kksoehtuwrn@quack3> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, May 27, 2024 at 03:34:30PM +0200, Jan Kara wrote: > So I was wondering how this is actually working in practice. Checking the > code, NFS server is (based on configuration in /etc/exports) either using > device number as the filesystem identifier or fsid / uuid as specified in > /etc/exports. Yes, it's a rather suboptimal implementation. > So returning the 64-bit mount ID from name_to_handle_at() weasels out of > these "how to identify arbitrary superblock" problems by giving userspace a > reasonably reliable way to generate this superblock identifier itself. I'm > fully open to less errorprone API for this but at this point I don't see it > so changing the mount ID returned from name_to_handle_at() to 64-bit unique > one seems like a sane practical choice to me... Well, how about we fix the thing for real: - allow file systems to provide a uniqueu identifier of at least uuid size (16 bytes) in the superblock or through an export operation - for non-persistent file systems allow to generate one at boot time using the normal uuid generation helpers - add a new flag to name_to_handle_at/open_by_handle_at to include it in the file handle, and thus make the file handle work more like the normal file handle - add code to nfsd to directly make use of this This would solve all the problems in this proposal as well as all the obvious ones it doesn't solve.