xfs
[Top] [All Lists]

Re: Bug: XFS prerealese for linux 2.4.

To: Magnus Roth <magnusroth@xxxxxxxxx>
Subject: Re: Bug: XFS prerealese for linux 2.4.
From: Keith Owens <kaos@xxxxxxxxxxxxxxxxx>
Date: Mon, 29 Jan 2001 10:58:47 +1100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: Your message of "Sun, 28 Jan 2001 12:11:25 -0800." <20010128201125.93490.qmail@web10011.mail.yahoo.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Sun, 28 Jan 2001 12:11:25 -0800 (PST), 
Magnus Roth <magnusroth@xxxxxxxxx> wrote:
>When i use bonnie++(1.00g) on /mnt/space and using
>X(XMMS playing, and also
>starting other applications) at the same time, there
>is a total
>lookup(reset is only way to restart) after a
>while(memory problem?).

Linus recently found a bug in shared memory handling that has these
symptoms.  The fix below is extracted from 2.4.1-pre11 and ported to
2.4.0-xfs.  Does it fix your problem?


===========================================================================
Index: linux/mm/memory.c
===========================================================================

--- /usr/tmp/TmpDir.7386-0/linux/mm/memory.c_1.42       Mon Jan 29 11:24:10 2001
+++ linux/mm/memory.c   Mon Jan 29 11:22:43 2001
@@ -943,7 +943,6 @@
        if (inode->i_size < offset)
                goto do_expand;
        inode->i_size = offset;
-       truncate_inode_pages(mapping, offset,TRUNC_TOSS);
        spin_lock(&mapping->i_shared_lock);
        if (!mapping->i_mmap && !mapping->i_mmap_shared)
                goto out_unlock;
@@ -958,8 +957,7 @@
 
 out_unlock:
        spin_unlock(&mapping->i_shared_lock);
-       /* this should go into ->truncate */
-       inode->i_size = offset;
+       truncate_inode_pages(mapping, offset,TRUNC_TOSS);
        if (inode->i_op && inode->i_op->truncate)
                inode->i_op->truncate(inode);
        return;

===========================================================================
Index: linux/mm/shmem.c
===========================================================================

--- /usr/tmp/TmpDir.7386-0/linux/mm/shmem.c_1.2 Mon Jan 29 11:24:10 2001
+++ linux/mm/shmem.c    Mon Jan 29 11:20:14 2001
@@ -204,8 +204,11 @@
        if (info->locked)
                return 1;
        swap = __get_swap_page(2);
-       if (!swap.val)
-               return 1;
+       if (!swap.val) {
+               set_page_dirty(page);
+               UnlockPage(page);
+               return -ENOMEM;
+       }
 
        spin_lock(&info->lock);
        entry = shmem_swp_entry (info, page->index);


<Prev in Thread] Current Thread [Next in Thread>