linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@conectiva.com.br>
To: Christoph Rohland <cr@sap.com>, "Stephen C. Tweedie" <sct@redhat.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-mm@kvack.org
Subject: [PATCH] shmem fixes against 2.4.3-ac2
Date: Thu, 5 Apr 2001 03:11:12 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0104050304250.9033-100000@freak.distro.conectiva> (raw)

Hi, 

The following patch fixes two bugs in the shm code in 2.4.3-ac2 (and ac3,
too): 

 - shmem_writepage() does not set the page dirty bit on a page in case it
   does not get moved to the swapcache because it has pte's mapped to it. 

 - in case of a SIGBUS for a page fault on an shmem page, the inode lock
   will remain locked forever.



--- mm/shmem.c.orig	Wed Apr  4 06:44:45 2001
+++ mm/shmem.c	Thu Apr  5 04:39:03 2001
@@ -236,8 +236,10 @@
 	
 	/* Only move to the swap cache if there are no other users of
 	 * the page. */
-	if (atomic_read(&page->count) > 2)
+	if (atomic_read(&page->count) > 2) {
+		set_page_dirty(page);
 		goto out;
+	}
 	
 	inode = page->mapping->host;
 	info = &inode->u.shmem_i;
@@ -432,6 +434,7 @@
 		*ptr = NOPAGE_SIGBUS;
 	return error;
 sigbus:
+	up (&inode->i_sem);
 	*ptr = NOPAGE_SIGBUS;
 	return -EFAULT;
 }


--
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/

                 reply	other threads:[~2001-04-05  6:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.21.0104050304250.9033-100000@freak.distro.conectiva \
    --to=marcelo@conectiva.com.br \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cr@sap.com \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.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