Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4aa0d230c2cfc1ac4bcf7c5466f9943cf14233a9
Commit:     4aa0d230c2cfc1ac4bcf7c5466f9943cf14233a9
Parent:     82d5b9a7c63054a9a2cd838ffd177697f86e7e34
Author:     Dave Kleikamp <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 17 21:18:35 2007 -0600
Committer:  Dave Kleikamp <[EMAIL PROTECTED]>
CommitDate: Wed Jan 17 21:18:35 2007 -0600

    JFS: call io_schedule() instead of schedule() to avoid deadlock
    
    The introduction of Jens Axboe's explicit i/o plugging patches introduced a
    deadlock in jfs.  This was caused by the process initiating I/O not
    unplugging the queue before waiting on the commit thread.  The commit
    thread itself was waiting for that I/O to complete.  Calling io_schedule()
    rather than schedule() unplugs the I/O queue avoiding the deadlock, and it
    appears to be the right function to call in any case.
    
    Signed-off-by: Dave Kleikamp <[EMAIL PROTECTED]>
---
 fs/jfs/jfs_lock.h     |    2 +-
 fs/jfs/jfs_metapage.c |    2 +-
 fs/jfs/jfs_txnmgr.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/jfs/jfs_lock.h b/fs/jfs/jfs_lock.h
index 7d78e83..df48ece 100644
--- a/fs/jfs/jfs_lock.h
+++ b/fs/jfs/jfs_lock.h
@@ -42,7 +42,7 @@ do {                                                  \
                if (cond)                               \
                        break;                          \
                unlock_cmd;                             \
-               schedule();                             \
+               io_schedule();                          \
                lock_cmd;                               \
        }                                               \
        current->state = TASK_RUNNING;                  \
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index ceaf03b..58deae0 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -56,7 +56,7 @@ static inline void __lock_metapage(struct metapage *mp)
                set_current_state(TASK_UNINTERRUPTIBLE);
                if (metapage_locked(mp)) {
                        unlock_page(mp->page);
-                       schedule();
+                       io_schedule();
                        lock_page(mp->page);
                }
        } while (trylock_metapage(mp));
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index d558e51..6988a10 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -135,7 +135,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * 
event)
        add_wait_queue(event, &wait);
        set_current_state(TASK_UNINTERRUPTIBLE);
        TXN_UNLOCK();
-       schedule();
+       io_schedule();
        current->state = TASK_RUNNING;
        remove_wait_queue(event, &wait);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to