From owner-freebsd-fs@freebsd.org Wed Oct 31 08:02:10 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE4BE107CEC3 for ; Wed, 31 Oct 2018 08:02:09 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582496A4AE for ; Wed, 31 Oct 2018 08:02:09 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f196.google.com with SMTP id a28-v6so10911788ljd.6 for ; Wed, 31 Oct 2018 01:02:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=m1rK9cn8575AbZgzGe8P3MTm6WkUbt53k4uQFfXnoDs=; b=hpKK3Tzz1p6Btegxyxyz1PnKHGrQK4mbCYk9YgGvVXO6jybVEV76XEfKsAZdQACJoY eYZ0mdcm5h6wreC0Mm/NUvQUMVoc6du/erXTZ0uOS6BxR1qFGg6qpYhNq/YTtWC1+pqn kr6UCL7IhCVz7C11+Pr3z50digt4GJPmhyUpSXX4W870QA8uvIm2U+bdJOImKSd8B/DJ Vsw6wU71Ylj6LdKLKKiO1QbA68Y6RLe12cR/f0NbOoHfSzqahQCoquGKCyH/iXWEVAMr sRFyYINAZtnVevCQx7+/ZFailUbKa/N1DvfXO4pF1n0b7NCN1ouoHoUbVfAiT8Lc+rdp v4IA== X-Gm-Message-State: AGRZ1gJoV333wwlopCb8QODRCuZiYzwZqVT4wwvaNEcDO4qZDcfZpkIO f1qvQEsKtLjdja9+U0ISpwM= X-Google-Smtp-Source: AJdET5cBZZaVMQekq5kBZdGqoqfKtX+FwsVHECx5J+nYpDCPZFXWTxAodCr0uHCQmZq1rkzzm3h7XQ== X-Received: by 2002:a2e:55d3:: with SMTP id g80-v6mr1442355lje.78.1540972927510; Wed, 31 Oct 2018 01:02:07 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id y9-v6sm3933605ljk.35.2018.10.31.01.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 01:02:06 -0700 (PDT) Subject: Re: How to fill in the fsid for file systems? To: Rick Macklem , Konstantin Belousov Cc: FreeBSD Filesystems , Josh Paetzel References: <20181030012240.GM5335@kib.kiev.ua> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlX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c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Wed, 31 Oct 2018 10:02:05 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 08:02:10 -0000 On 31/10/2018 04:23, Rick Macklem wrote: > Konstantin Belousov wrote: >> Why do you consider this an option for exports file and not for nmount(2) >> and fstab ? Do you intend to mangle fsid for mount protocol only ? > Well, Josh Paetzel proposed this. I believe it was because "that's how Linux > does it" (but I can't speak for Josh). > > The kernel code currently sets this via an nmount(2) option called "export.fsid". > Although Josh's patch has this done in mountd.c, it could simply be used as > a mount option in /etc/fstab or manual mounting. (The code currently processes > this option in vfs_domount_update(), so it would need to be moved to where > options are processed during mounting, but that wouldn't be hard.) > > This would actually avoid patching mountd.c. It would also avoid the fact that > the "export fsid option" applies to all clients and is not per-host or per-net. > (Doing it only for "exports" requires a moderate amount of code change, such > as a new function to be used instead of vfs_busyfs() to busy the file system > after looking up the fsid in the export stuff. I haven't coded this, so I'm not > sure how much work that would be?) > > I actually think making it a generic nmount(2) option and not an export specific > one sounds like a good idea. > > What do others think of making "fsid=N" a generic mount option for > overriding the selection of fsid done by the file system? > > rick > ps: Although I don't try to be "Linux incompatible", I don't see why we should > be compatible when doing it a slightly different way seems more logical. I see two issues here. One is practical. How do we provide fsid to ZFS filesystems? I mean I would hate to resort to mounting ZFS via fstab just to provide fsid whereas today ZFS filesystems are mounted auto-magically. We could add a FreeBSD specific fsid ZFS property, but that's also some extra code. The other issue is a potential design issue. Right now there is the "one true" fsid that's embedded into struct mount (mnt_stat.f_fsid) and NFS uses it to match a handle to a specific filesystem. Obviously, to support the fsid override we have to modify the one true fsid. My thinking is why can't NFS have its own fsid (equal to the one true fsid by default) that it would use internally to match the handle to an exported filesystem... In that case we would not need to alter the one true fsid (in struct mount), we would just set the NFS export fsid. In that case, I think, it would be natural that the fsid override is provided as an export option. This, of course, would require a new implementation for nfsvno_getfh() to use the NFS fsid instead of vp->v_mount->mnt_stat.f_fsid. Also, nfsd_fhtovp() would not be able to use vfs_busyfs(), instead it would do an internal look-up. Same for nfsvno_getvp(). [I think that nfsrvd_compound() would keep using the one true fsid]. But maybe this is a too radical idea? -- Andriy Gapon