Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1307889imm; Fri, 22 Jun 2018 14:14:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJtSJBVS85aWKmgiljTFAC4yl44g/cwxpao1KNCzJfkILwDZVW7cQaurThbH7I0s2Sykd6/ X-Received: by 2002:a65:524d:: with SMTP id q13-v6mr2775149pgp.244.1529702042689; Fri, 22 Jun 2018 14:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529702042; cv=none; d=google.com; s=arc-20160816; b=0nc4UVfD/5yCN+XYvqL6pYu9PGpF+l2cazasyx73tu5o4WnVvJbrwxsIzL/iJsBS4p WlcLIV5Gqnt0cM1rAj6aX03xjK7ocPFucngtLtRbisSca344LQ3OgcYrNHB14vRRxy34 M7ve/O2UHr5E7cycnKmGUcFPEUBU+hTBaTbGtaeJHG1G93jlQqEl2dXlPeyrWaFc4AS9 Jmzfh1Ir5ec/5xZtAh7dgVW2qQ+hpJY8U1sKBtJKgbsiNAHD4L56FO3wBLKOlHUHnaw9 +X07Zybz0sHk27EO/GmYZjyJZUVFUEcstHTkP363+wGh5bJrTzz3JVfd6XGdoDdrsx90 2Adg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CLD6dnZ41aLBLUck+TNu4DPtRb0BkDHuB2R0mhNEnww=; b=xun+iGbBeSx3VfWf9Zh6t0bA25nLUrRS3HcjZFGq1s3sbIBK/RuJ/QBf7c3EWpfZ4c +uc9gu0jHX1MeSw3TqYMZn+8kUQ+ddocXqO+MwVpVyJa7UdjH17ma0mrAFeQ5aLGrsr+ CbqLbilhc+Gz8e9kt72ht1teZrxLK9Ac9jOQgKvC8pkMAT83vM1V6MaB5CED2xkRapID R8p4JJE6UO3w+0vGtKjHLKok3N0ATB8UAIcLDjYe/rojjkhY3A7KnjDPAimEhnMH80Gk vVyyyGoTBjsK/YRJ6TmmKTHgn39+j4OwWQbXq2Gx2NsJ8MolZI+XEKFGRUn3WKz2m8qr kZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="YuJ/vtOW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13-v6si8419849plo.97.2018.06.22.14.13.48; Fri, 22 Jun 2018 14:14:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="YuJ/vtOW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754560AbeFVVND (ORCPT + 99 others); Fri, 22 Jun 2018 17:13:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59280 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754537AbeFVVNC (ORCPT ); Fri, 22 Jun 2018 17:13:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CLD6dnZ41aLBLUck+TNu4DPtRb0BkDHuB2R0mhNEnww=; b=YuJ/vtOW5D085m+U3hcGovr1N F7ejVIupjw930Pz2ebK7s+yphlLuPtBlEp6qg/lJiGDplitHTaJM3EnkBAIeMsqnoxpZouhjgykF4 A6kgS3m/RxYCxc37R0zrb43mlTzOMMfRUjCDSjGINt77dttVRZBfs8yZaPWpmsSrp9pCE1C7ErWv2 KLbbglOmERNQJ0DVSp3YTOK6Ohcf8am4e65F1WvQp3xcR9y3LG+oQ3OQ82jXRjTsBdk3A5yLlCF7e 9cK9Z6B2yAirxFjQPcw9iRLXnJ86Cq7zCIze62ILXQiILXvI07+ci5Bc63sTHlD1PbVifO+WpaQW5 dLlXbhcrg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fWTMZ-0004QO-PK; Fri, 22 Jun 2018 21:12:59 +0000 Date: Fri, 22 Jun 2018 14:12:59 -0700 From: Matthew Wilcox To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 05/26] fs: Convert unnamed_dev_ida to new API Message-ID: <20180622211259.GB18630@bombadil.infradead.org> References: <20180621212835.5636-1-willy@infradead.org> <20180621212835.5636-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 12:45:10PM -0700, Randy Dunlap wrote: > > + * Context: Any context. Frequently called while holding sb_lock. > > + * Return: 0 on success, -EMFILE if there are no anonymous bdevs left > > + * or -EAGAIN if memory allocation failed. > > Looks to me like the code used to return -ENOMEM and used -EAGAIN as an > internal retry code. > > confused? (/me) Quite right. +++ b/fs/super.c @@ -989,7 +989,7 @@ static DEFINE_IDA(unnamed_dev_ida); * * Context: Any context. Frequently called while holding sb_lock. * Return: 0 on success, -EMFILE if there are no anonymous bdevs left - * or -EAGAIN if memory allocation failed. + * or -ENOMEM if memory allocation failed. */ int get_anon_bdev(dev_t *p) { @@ -1002,9 +1002,9 @@ int get_anon_bdev(dev_t *p) dev = ida_alloc_range(&unnamed_dev_ida, 1, (1 << MINORBITS) - 1, GFP_ATOMIC); if (dev == -ENOSPC) - return -EMFILE; + dev = -EMFILE; if (dev < 0) - return -EAGAIN; + return dev; *p = MKDEV(0, dev); return 0;