Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6724140pxv; Fri, 30 Jul 2021 00:19:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXc1A6i4NgdOSPYoqwqJjIhjsJ8bC2eArIzV3XE1zvkWVGTzo+5OKJOg6YUUK/CkDIkNB2 X-Received: by 2002:a05:6638:c58:: with SMTP id g24mr1022809jal.63.1627629574505; Fri, 30 Jul 2021 00:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627629574; cv=none; d=google.com; s=arc-20160816; b=pfYfSeWGWOxlU2zXpKJnifaVwxcdZ17441RXE5iUgZGQ+KueB55O2GzreETXMtO6Cr EaCRoDCx0qHko7kNpF1FixwSSwV2wIYU9yRWETeYg/FcftW/kjh4RdvUkfTGV8LOmqSm xGbwgkFteHMelH6DswmDdDiYhhpckcoK9TLIBpyUwY2Oilnyz6w6Opa2F2kB6FnMKsAO KuuAJV26ZmnvF0kzHzBSpYO+iYCYvSZnooK8a4WYz1HYuUVDn8E+hafN+IAnQYbiizaI Pq0ikNFu7jScBVA4gvzcXX4pKQ1/URuHBBVxGcNl8UhlSS1fjsYJAsU9sH6xGsOLAuNj QZ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=D15pokXBL/I5gJU0P70zkw18CmA6/e8A1wCKqftQ0jo=; b=RLJk96louLQO/DHOjH57qhzAAuhI9+mHiphjUJA4mYTOqthj8x2qICBWB2SFE2PBou rTu8iQjFA8NHsvm5ja1aEitO/prQK4vr0lOgr/kjNL5ahQ7GFFUqykidJv8JdtgdGRwS 4zjfkIIIw6yMm1xGBSvvjrkq7MyyPacomWgAi3qlv07auCRd/m3axOX9oI818OF/7CIh lNc2WI8Ovm3lpoH6HPdoTZt0sJJ/wjlOhzI7fIpvEU6l5we+Apu8JKWhqbTUWDWpCAZl NuUsNI7L6tH/D1tsoC42axL6dlOqkq1bj7T2c0+HkgIb3XuaNdtfDtQeBda+601/Vvay iRQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="SelIT/vt"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si869548jat.64.2021.07.30.00.19.14; Fri, 30 Jul 2021 00:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="SelIT/vt"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237604AbhG3HSm (ORCPT + 99 others); Fri, 30 Jul 2021 03:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237667AbhG3HSk (ORCPT ); Fri, 30 Jul 2021 03:18:40 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC65C0613CF for ; Fri, 30 Jul 2021 00:18:36 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id j10so4925613vsl.10 for ; Fri, 30 Jul 2021 00:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D15pokXBL/I5gJU0P70zkw18CmA6/e8A1wCKqftQ0jo=; b=SelIT/vtgcNRB5mPXijJtBqG7k2rfe3avRxhQIKcwriibkwOQ6G8fwGFSykbXaMnY+ ft1VFxdfb8HJvMxKk6zPdM5O+5am17GFZ1gEtwutHdq5QuST9uW46dW38jCkGZ/zbV/4 s6FCFy3ylqh0YivuoVbTijf/RIBxlLYirqbn0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D15pokXBL/I5gJU0P70zkw18CmA6/e8A1wCKqftQ0jo=; b=X252GzfH6lkDiEQDS/EsdCP4BYuisy4s+kVovqvdZBVHOt3WIs3yDKOibUU3Q0Xw0W ZHZcA9UurXmMfAA7fE6AzxZ5hrYgw88LD6euYIlTeEsdusjPkD4++nALfA9oDib9sLn1 kFcCssrdgc9p60BdEZTu/u9+yeYJOqKKbU5dNAH9Gkh4L29yMF9HLmUuHM3DuopSZBUC 0bKgllFdiFFfGv7zpb2EULfqC/RgXEx8Gz6OD4ivUb5mPNFs5Bw5G6FB3TKAg8Zp1pGX 7r01VRGReNTpK/meNjFzv/c2d939Y5PmPs/554GtBzHUem57gi+Zr43z7P0DORsGs5LH fpfA== X-Gm-Message-State: AOAM532uTlpIP+wizJxfMOeeePCBKM3B4ydc60dF8kPLg0S/yHZSrAEE 7xttV/OmPG8TsE4kOh7fmEDILtYF2EmT1FS1tpCHiw== X-Received: by 2002:a67:c009:: with SMTP id v9mr478988vsi.47.1627629515318; Fri, 30 Jul 2021 00:18:35 -0700 (PDT) MIME-Version: 1.0 References: <162742539595.32498.13687924366155737575.stgit@noble.brown> <162742546548.32498.10889023150565429936.stgit@noble.brown> <162762290067.21659.4783063641244045179@noble.neil.brown.name> <162762562934.21659.18227858730706293633@noble.neil.brown.name> In-Reply-To: <162762562934.21659.18227858730706293633@noble.neil.brown.name> From: Miklos Szeredi Date: Fri, 30 Jul 2021 09:18:24 +0200 Message-ID: Subject: Re: [PATCH 01/11] VFS: show correct dev num in mountinfo To: NeilBrown Cc: Al Viro , Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , linux-fsdevel@vger.kernel.org, Linux NFS list , Btrfs BTRFS Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, 30 Jul 2021 at 08:13, NeilBrown wrote: > > On Fri, 30 Jul 2021, Miklos Szeredi wrote: > > On Fri, 30 Jul 2021 at 07:28, NeilBrown wrote: > > > > > > On Fri, 30 Jul 2021, Al Viro wrote: > > > > On Wed, Jul 28, 2021 at 08:37:45AM +1000, NeilBrown wrote: > > > > > /proc/$PID/mountinfo contains a field for the device number of the > > > > > filesystem at each mount. > > > > > > > > > > This is taken from the superblock ->s_dev field, which is correct for > > > > > every filesystem except btrfs. A btrfs filesystem can contain multiple > > > > > subvols which each have a different device number. If (a directory > > > > > within) one of these subvols is mounted, the device number reported in > > > > > mountinfo will be different from the device number reported by stat(). > > > > > > > > > > This confuses some libraries and tools such as, historically, findmnt. > > > > > Current findmnt seems to cope with the strangeness. > > > > > > > > > > So instead of using ->s_dev, call vfs_getattr_nosec() and use the ->dev > > > > > provided. As there is no STATX flag to ask for the device number, we > > > > > pass a request mask for zero, and also ask the filesystem to avoid > > > > > syncing with any remote service. > > > > > > > > Hard NAK. You are putting IO (potentially - network IO, with no upper > > > > limit on the completion time) under namespace_sem. > > > > > > Why would IO be generated? The inode must already be in cache because it > > > is mounted, and STATX_DONT_SYNC is passed. If a filesystem did IO in > > > those circumstances, it would be broken. > > > > STATX_DONT_SYNC is a hint, and while some network fs do honor it, not all do. > > > > That's ... unfortunate. Rather seems to spoil the whole point of having > a flag like that. Maybe it should have been called > "STATX_SYNC_OR_SYNC_NOT_THERE_IS_NO_GUARANTEE" And I guess just about every filesystem would need to be fixed to prevent starting I/O on STATX_DONT_SYNC, as block I/O could just as well generate network traffic. Probably much easier fix btrfs to use some sort of subvolume structure that the VFS knows about. I think there's been talk about that for a long time, not sure where it got stalled. Thanks, Miklos