[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180622211259.GB18630@bombadil.infradead.org>
Date: Fri, 22 Jun 2018 14:12:59 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: linux-kernel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 05/26] fs: Convert unnamed_dev_ida to new API
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;
Powered by blists - more mailing lists