Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp562259pxv; Thu, 15 Jul 2021 10:17:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrQSzlT2yilmMghmsvDoMUXjzR+MBOdB2Z6urOKAynd+Q6dhC3hFrLDUmzeivAN8mu+VOG X-Received: by 2002:a17:906:dfc2:: with SMTP id jt2mr6942183ejc.388.1626369426420; Thu, 15 Jul 2021 10:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626369426; cv=none; d=google.com; s=arc-20160816; b=DaWbmWVuRJeKKy6ZQjCl3JvU+bvfM0IZULBs7Wi3Je1QZvMT7AUoFM1y86dpzkp/y+ GPR8efAbb7U6NoeapFFume8KhRYV/REfUXBgEoCTcZWUdIcEGZSbZaatdOEzkWPoZRiF q6Q3q4Ph7nE7eWIyuOui4uqhCOjihS8toarhhfcq4C0ELj/tQtFNsuoniuIW/RMbFzPP jxbquX73CRDjuTgrt+Oem+ilXRY5DVz8sG/y0ZzdxVCSboWPCfjge8nMVmkVOOzn2Uwc Be+QzGlm8UgjZuWLOrZyQO/ZU8Ynd9yUdxHg+NRjjzO2K8/VXuXoqQBPrdyweuQ5UIqA QEtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/7GiXib3FgEjPnkD4KLHXuIXZQxX/7FD3SVEsgiVNzY=; b=mTLh1JaTAYhofW0sSWHG98m/UPXY1Hu//CgcP9Y3hgVrIJYGkixdCzfB2VmglKR0hC Q8h37Yebpog3PnO16o57F33Fsw2uT3a5KLnJNR3cFOojbQ2XvZ0z1SJArovMsYPA1b60 braIvT5qtuc9n6UWnGSjb8UeH/EZeBi8ug8ZmQZYBf2d+fDaY2YBp3uSK1v7cPZgabBO HOrqVBROq+B2Q5o+4cjkhU33nfUAqB9PMcVt6oRG3Y+Xu13Sgh4os9rrCQ+SLbnPaUkb YmvZ0GSsxmnQpDcFp23/OU1W8L6TyZgW2/+1VvewL4aUMyP0KOEx+PZFbpmmvszlO0AC dlgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dME7+2nc; 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 d10si7864261ejr.696.2021.07.15.10.16.31; Thu, 15 Jul 2021 10:17:06 -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=@infradead.org header.s=casper.20170209 header.b=dME7+2nc; 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 S235167AbhGOQtc (ORCPT + 99 others); Thu, 15 Jul 2021 12:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235611AbhGOQt1 (ORCPT ); Thu, 15 Jul 2021 12:49:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675D9C0613E0; Thu, 15 Jul 2021 09:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=/7GiXib3FgEjPnkD4KLHXuIXZQxX/7FD3SVEsgiVNzY=; b=dME7+2ncCfG2ezk4CF7jiu1RpM r5+knDZtC4nH4E/BqHKQOr8VxzIaJ2BWu0IQysCWbZoLYJ2kAXh47/EyK9Yzle5ualiHEIqyELU4d NGch2dBbSGdUf/fAnibR2iaNndlmKMexlohGDPysHKllwJzHw2SV6ys4ZqgC/KHe/eCIGjw2hqjHN RKz2OKYT4beY6/XKx1LEcR3lbYsk3LNVs5TvwzyoaaszNhyAS9OZrYUWbDGsJoQTspPmgoiaaymci lPy+wmIU1/Xsr4UIIjXLXjxu+WLDEkrw4yflgfcPRlLPzH8sw5gKhZXdOomFlM/Ss1ZM4mm+pWfa9 9V6qZ4yw==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m44U6-003WwI-Az; Thu, 15 Jul 2021 16:45:23 +0000 Date: Thu, 15 Jul 2021 17:45:14 +0100 From: Christoph Hellwig To: Josef Bacik Cc: NeilBrown , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , linux-nfs@vger.kernel.org, Wang Yugui , Ulli Horlacher , linux-btrfs@vger.kernel.org Subject: Re: [PATCH/RFC] NFSD: handle BTRFS subvolumes better. Message-ID: References: <20210613115313.BC59.409509F4@e16-tech.com> <20210310074620.GA2158@tik.uni-stuttgart.de> <162632387205.13764.6196748476850020429@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jul 15, 2021 at 10:09:37AM -0400, Josef Bacik wrote: > I'm going to restate what I think the problem is you're having just so I'm > sure we're on the same page. > > 1. We export a btrfs volume via nfsd that has multiple subvolumes. > 2. We run find, and when we stat a file, nfsd doesn't send along our bogus > st_dev, it sends it's own thing (I assume?). This confuses du/find because > you get the same inode number with different parents. > > Is this correct? If that's the case then it' be relatively straightforward > to add another callback into export_operations to grab this fsid right? > Hell we could simply return the objectid of the root since that's unique > across the entire file system. We already do our magic FH encoding to make > sure we keep all this straight for NFS, another callback to give that info > isn't going to kill us. Thanks, Hell no. btrfs is broken plain and simple, and we've been arguing about this for years without progress. btrfs needs to stop claiming different st_dev inside the same mount, otherwise hell is going to break lose left right and center, and this is just one of the many cases where it does.