All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Rohland <cr@sap.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Linus Torvalds <torvalds@transmeta.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Ben LaHaise <bcrl@redhat.com>
Subject: Re: [PATCH] Fix races in 2.4.2-ac22 SysV shared memory
Date: 28 Mar 2001 11:18:16 +0200	[thread overview]
Message-ID: <m3g0fz3qd0.fsf@linux.local> (raw)
In-Reply-To: 20010323011331.J7756@redhat.com

Hi Stephen,

On Fri, 23 Mar 2001, Stephen C. Tweedie wrote:
> @@ -234,11 +243,11 @@
>  		return -ENOMEM;
>  	}
>  
> -	spin_lock(&info->lock);
> -	shmem_recalc_inode(page->mapping->host);
>  	entry = shmem_swp_entry(info, page->index); 
>	if (IS_ERR(entry)) /* this had been allocted on page allocation */
>  		BUG();
> +	spin_lock(&info->lock);
> +	shmem_recalc_inode(page->mapping->host);
>  	error = -EAGAIN;
>  	if (entry->val) {
>  		__swap_free(swap, 2);

I think this is wrong. The spinlock protects us against
shmem_truncate. shmem_swp_entry cannot sleep in this case since the
entry is allocated in nopage.

Greetings
		Christoph



WARNING: multiple messages have this Message-ID (diff)
From: Christoph Rohland <cr@sap.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Linus Torvalds <torvalds@transmeta.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Ben LaHaise <bcrl@redhat.com>
Subject: Re: [PATCH] Fix races in 2.4.2-ac22 SysV shared memory
Date: 28 Mar 2001 11:18:16 +0200	[thread overview]
Message-ID: <m3g0fz3qd0.fsf@linux.local> (raw)
In-Reply-To: 20010323011331.J7756@redhat.com

Hi Stephen,

On Fri, 23 Mar 2001, Stephen C. Tweedie wrote:
> @@ -234,11 +243,11 @@
>  		return -ENOMEM;
>  	}
>  
> -	spin_lock(&info->lock);
> -	shmem_recalc_inode(page->mapping->host);
>  	entry = shmem_swp_entry(info, page->index); 
>	if (IS_ERR(entry)) /* this had been allocted on page allocation */
>  		BUG();
> +	spin_lock(&info->lock);
> +	shmem_recalc_inode(page->mapping->host);
>  	error = -EAGAIN;
>  	if (entry->val) {
>  		__swap_free(swap, 2);

I think this is wrong. The spinlock protects us against
shmem_truncate. shmem_swp_entry cannot sleep in this case since the
entry is allocated in nopage.

Greetings
		Christoph


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  parent reply	other threads:[~2001-03-28  9:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-23  1:13 [PATCH] Fix races in 2.4.2-ac22 SysV shared memory Stephen C. Tweedie
2001-03-23 19:58 ` Linus Torvalds
2001-03-23 19:58   ` Linus Torvalds
2001-03-23 22:20   ` Alan Cox
2001-03-23 22:20     ` Alan Cox
2001-03-23 22:23     ` Alexander Viro
2001-03-23 22:23       ` Alexander Viro
2001-03-23 22:29       ` Alan Cox
2001-03-23 22:29         ` Alan Cox
2001-03-23 22:27     ` Linus Torvalds
2001-03-23 22:27       ` Linus Torvalds
2001-03-23 22:35       ` Alan Cox
2001-03-23 22:35         ` Alan Cox
2001-03-23 22:37         ` Linus Torvalds
2001-03-23 22:37           ` Linus Torvalds
2001-03-23 22:31     ` David S. Miller
2001-03-23 22:31       ` David S. Miller
2001-03-25  0:13   ` Stephen C. Tweedie
2001-03-25  0:13     ` Stephen C. Tweedie
2001-03-25  1:05     ` Rik van Riel
2001-03-25  1:05       ` Rik van Riel
2001-03-25 16:50       ` Stephen C. Tweedie
2001-03-25 16:50         ` Stephen C. Tweedie
2001-03-28  9:18 ` Christoph Rohland [this message]
2001-03-28  9:18   ` Christoph Rohland

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=m3g0fz3qd0.fsf@linux.local \
    --to=cr@sap.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bcrl@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    --cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.