From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christian Brauner <christian@brauner.io>
Cc: gregkh@linuxfoundation.org, tkjos@android.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
joel@joelfernandes.org, arve@android.com, maco@android.com,
Todd Kjos <tkjos@google.com>
Subject: Re: [PATCH v1 1/2] binderfs: implement "max" mount option
Date: Wed, 2 Jan 2019 12:17:31 +0300 [thread overview]
Message-ID: <20190102091731.GB3781@kadam> (raw)
In-Reply-To: <20181223143550.10672-1-christian@brauner.io>
On Sun, Dec 23, 2018 at 03:35:49PM +0100, Christian Brauner wrote:
> static inline struct binderfs_info *BINDERFS_I(const struct inode *inode)
> @@ -110,10 +132,16 @@ static int binderfs_binder_device_create(struct inode *ref_inode,
>
> /* Reserve new minor number for the new device. */
> mutex_lock(&binderfs_minors_mutex);
> - minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL);
> + if (++info->device_count <= info->mount_opts.max)
> + minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR,
> + GFP_KERNEL);
> + else
> + minor = -ENOSPC;
> mutex_unlock(&binderfs_minors_mutex);
> - if (minor < 0)
> + if (minor < 0) {
> + --info->device_count;
Isn't this decrement supposed to happen under binderfs_minors_mutex?
> return minor;
> + }
regards,
dan carpenter
next prev parent reply other threads:[~2019-01-02 9:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-23 14:35 [PATCH v1 1/2] binderfs: implement "max" mount option Christian Brauner
2018-12-23 14:35 ` [PATCH v1 2/2] binderfs: reserve devices for initial mount Christian Brauner
2019-01-03 20:25 ` Todd Kjos
2019-01-03 20:34 ` Christian Brauner
2019-01-03 21:47 ` Todd Kjos
2019-01-03 22:08 ` Christian Brauner
2019-01-03 22:27 ` Todd Kjos
2018-12-24 11:09 ` [PATCH v1 1/2] binderfs: implement "max" mount option Christian Brauner
2018-12-24 11:45 ` Greg KH
2018-12-24 11:48 ` Christian Brauner
2019-01-02 9:17 ` Dan Carpenter [this message]
2019-01-02 11:16 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190102091731.GB3781@kadam \
--to=dan.carpenter@oracle.com \
--cc=arve@android.com \
--cc=christian@brauner.io \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=tkjos@android.com \
--cc=tkjos@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox