public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: npiggin@suse.de, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org
Subject: Re: [locking bug] inotify: inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
Date: Wed, 18 Feb 2009 14:26:42 -0800	[thread overview]
Message-ID: <20090218142642.2505ed5f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090216081304.GA18980@elte.hu>

On Mon, 16 Feb 2009 09:13:04 +0100
Ingo Molnar <mingo@elte.hu> wrote:

> --- a/fs/notify/inotify/inotify.c
> +++ b/fs/notify/inotify/inotify.c
> @@ -156,7 +156,7 @@ static int inotify_handle_get_wd(struct inotify_handle *ih,
>  	int ret;
>  
>  	do {
> -		if (unlikely(!idr_pre_get(&ih->idr, GFP_KERNEL)))
> +		if (unlikely(!idr_pre_get(&ih->idr, GFP_NOFS)))

Geeze the IDR interface sucks.

>  			return -ENOSPC;

Well that doesn't make a lot of sense.

>  		ret = idr_get_new_above(&ih->idr, watch, ih->last_wd+1, &watch->wd);
>  	} while (ret == -EAGAIN);

And afacit that can't happen.  We hold the lock, so if idr_pre_get()
succeeded, idr_get_new_above() will not return -EAGAIN (which should
have been -ENOMEM).

I'd better stop looking.


      parent reply	other threads:[~2009-02-18 22:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16  8:13 [locking bug] inotify: inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage Ingo Molnar
2009-02-16 10:34 ` Peter Zijlstra
2009-02-16 10:46   ` MinChan Kim
2009-02-18 22:26 ` Andrew Morton [this message]

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=20090218142642.2505ed5f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    /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