xfs
[Top] [All Lists]

fix 2.4-xfs pagebuf request

To: linux-xfs@xxxxxxxxxxx
Subject: fix 2.4-xfs pagebuf request
From: ASANO Masahiro <masano@xxxxxxxxxxxxxx>
Date: Sun, 27 Oct 2002 16:13:51 +0900 (JST)
Sender: linux-xfs-bounce@xxxxxxxxxxx
Hi,

I found a bug at current 2.4 CVS about `struct pagesync_t'.
Some driver top-half may call buffer_head.b_end_io() on process
context (not interrupt context). So _end_pagebuf_page_io_multi() may
be called several times with remain==1.

Please fix it. Here is a patch.
--
Masano

--- linux/fs/xfs/pagebuf/page_buf.c     Fri Oct 25 07:46:20 2002
+++ linux/fs/xfs/pagebuf/page_buf.c.new Sun Oct 27 15:53:38 2002
@@ -1645,7 +1645,7 @@
                                BUG();  /* Ugh - out of memory condition here */
                        psync->pb = pb;
                        psync->locking = locking;
-                       atomic_set(&psync->remain, 0);
+                       atomic_set(&psync->remain, cnt);
 
                        callback = public_bh ?
                                   _end_io_multi_part : _end_io_multi_full;
@@ -1667,7 +1667,6 @@
                        /* Complete the buffer_head, then submit the IO */
                        if (psync) {
                                init_buffer(bh, callback, psync);
-                               atomic_inc(&psync->remain);
                        } else {
                                init_buffer(bh, callback, pb);
                        }


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