Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6691422pxv; Thu, 29 Jul 2021 23:14:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR99eUgh6rD0/57zN6H6NrZnrFeCrWViWCvr1yYoqAkmILNwPnnRolDmSkGMtlLM2qlg4Q X-Received: by 2002:a5e:961a:: with SMTP id a26mr497949ioq.90.1627625668615; Thu, 29 Jul 2021 23:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627625668; cv=none; d=google.com; s=arc-20160816; b=yyQGP0yTdTs5qS/rczPC6osuIREOoaMO0+C9S3Y82+AnLjx1IhZAta6lDrs+rm7fh1 /AroNoVyNOhb+erTvo6DvD0yelVHEikH+UtcgsqWCMPoofDKGa+TLwDimotQDfM7lt/4 4BMZ2x75kFgTnpVFHawjrLGcOzugG+n/N2A/++3LUbbwLX2R5LnHnahLGhoYxYp3cbYn IZFHf1uKrz4dVZXaiptMWwJGOww3ZrplnRZQ4QvjrEeL+kPfBd65EqA1+wSOA9BqPoGm NHhs+/fcU5Yfir1S0vEHx7Cl6L2HOJ0xROY9kY+h4Wz6sDtXapeydzxc+IkkdFR9cZX7 wYHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=m2yEmtTaGWEawyT0nrZUfA07XI3cxeb2AJlM17C7sQw=; b=puQsE1HKdfE7cS6k6RY/8FkHJnhx8GeAcTk3ioDVWkavxY/E243kCPAbUFv3W/VmzI cOsodfNxYXhsx05SGIr/MCzUuYxUfy6Pt7Qq8rwok1PW7gumXay+NWYgLG18r/uEFBwa eThPZkUnlDsz9wh/LlOcHfYb+ymXK1mZktWGJCZCHB/DWOt/O4sqfi0S4rN/8dOyleVU tsdSk8GfEEZx2a6+iihPGw8n1UWON6tH3rG/fLbMgQugmcw7X1sGgi6c2WZXCzizp0fg L+uzucrrLbLKWY31M+lgis2RBTzezoIoRi1LONOBxcaKg4V4V0VK02fa9ydgw/IvwVP1 J8Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pOOrMoue; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=PgBZAjsr; 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 h4si628387ilj.137.2021.07.29.23.14.11; Thu, 29 Jul 2021 23:14:28 -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=pass header.i=@suse.de header.s=susede2_rsa header.b=pOOrMoue; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=PgBZAjsr; 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 S233890AbhG3GOC (ORCPT + 99 others); Fri, 30 Jul 2021 02:14:02 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:56770 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237369AbhG3GOA (ORCPT ); Fri, 30 Jul 2021 02:14:00 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6346122127; Fri, 30 Jul 2021 06:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627625635; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m2yEmtTaGWEawyT0nrZUfA07XI3cxeb2AJlM17C7sQw=; b=pOOrMoueTAs+B0POnYeyPIGzcwr3wsglAn1PfF8hHOdH/qPB4OukxIqYv+yiyrBAIE+i3q J7BY8vBcz7tTni1j2dKTnmFvAm+tDuuoBxGU4/6LuWoNj4iDFMV2N3VERodVCfyA+3GYDK O/GY535+tItlnMNVMgn15js54m326dg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627625635; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m2yEmtTaGWEawyT0nrZUfA07XI3cxeb2AJlM17C7sQw=; b=PgBZAjsrC/EfJMLt2gSqpfJMY/nPfocm1s44eLwMlBWpzVRHHFfXR8eJe5Zb5M4/Y7P9vH 5HRCP7fGbfZAfZBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 319AF13BFD; Fri, 30 Jul 2021 06:13:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GbCIN5+YA2ETBQAAMHmgww (envelope-from ); Fri, 30 Jul 2021 06:13:51 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Miklos Szeredi" 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" Subject: Re: [PATCH 01/11] VFS: show correct dev num in mountinfo In-reply-to: References: <162742539595.32498.13687924366155737575.stgit@noble.brown>, <162742546548.32498.10889023150565429936.stgit@noble.brown>, , <162762290067.21659.4783063641244045179@noble.neil.brown.name>, Date: Fri, 30 Jul 2021 16:13:49 +1000 Message-id: <162762562934.21659.18227858730706293633@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 multip= le > > > > 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 ->d= ev > > > > 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. >=20 > STATX_DONT_SYNC is a hint, and while some network fs do honor it, not all d= o. >=20 That's ... unfortunate. Rather seems to spoil the whole point of having a flag like that. Maybe it should have been called=20 "STATX_SYNC_OR_SYNC_NOT_THERE_IS_NO_GUARANTEE" Thanks. NeilBrown