Bugzilla – Attachment 47757 Details for
Bug 113237
XFS oops when trying installation repair
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
xfsbufd startup and wakeup fixes
xfsbufd-fixes (text/plain), 2.05 KB, created by
Christoph Hellwig
on 2005-08-26 11:38:09 UTC
(
hide
)
Description:
xfsbufd startup and wakeup fixes
Filename:
MIME Type:
Creator:
Christoph Hellwig
Created:
2005-08-26 11:38:09 UTC
Size:
2.05 KB
patch
obsolete
>Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c >=================================================================== >--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c 2005-08-11 16:46:03.000000000 +0200 >+++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c 2005-08-26 13:31:07.000000000 +0200 >@@ -54,6 +54,7 @@ > #include <linux/percpu.h> > #include <linux/blkdev.h> > #include <linux/hash.h> >+#include <linux/kthread.h> > > #include "xfs_linux.h" > >@@ -1733,9 +1734,7 @@ > } > > /* Defines for pagebuf daemon */ >-STATIC DECLARE_COMPLETION(xfsbufd_done); > STATIC struct task_struct *xfsbufd_task; >-STATIC int xfsbufd_active; > STATIC int xfsbufd_force_flush; > STATIC int xfsbufd_force_sleep; > >@@ -1744,10 +1743,15 @@ > int priority, > unsigned int mask) > { >- if (xfsbufd_force_sleep) >+ if (xfsbufd_force_sleep || !priority) > return 0; >+ if (!xfsbufd_task) { >+ WARN_ON(1); >+ return 0; >+ } >+ > xfsbufd_force_flush = 1; >- barrier(); >+ wmb(); > wake_up_process(xfsbufd_task); > return 0; > } >@@ -1761,14 +1765,8 @@ > xfs_buftarg_t *target; > xfs_buf_t *pb, *n; > >- /* Set up the thread */ >- daemonize("xfsbufd"); > current->flags |= PF_MEMALLOC; > >- xfsbufd_task = current; >- xfsbufd_active = 1; >- barrier(); >- > INIT_LIST_HEAD(&tmp); > do { > if (unlikely(freezing(current))) { >@@ -1816,9 +1814,9 @@ > purge_addresses(); > > xfsbufd_force_flush = 0; >- } while (xfsbufd_active); >+ } while (!kthread_should_stop()); > >- complete_and_exit(&xfsbufd_done, 0); >+ return 0; > } > > /* >@@ -1901,9 +1899,11 @@ > if (!xfsdatad_workqueue) > goto out_destroy_xfslogd_workqueue; > >- error = kernel_thread(xfsbufd, NULL, CLONE_FS|CLONE_FILES); >- if (error < 0) >+ xfsbufd_task = kthread_run(xfsbufd, NULL, "xfsbufd"); >+ if (IS_ERR(xfsbufd_task)) { >+ error = PTR_ERR(xfsbufd_task); > goto out_destroy_xfsdatad_workqueue; >+ } > return 0; > > out_destroy_xfsdatad_workqueue: >@@ -1920,10 +1920,7 @@ > STATIC void > xfs_buf_daemons_stop(void) > { >- xfsbufd_active = 0; >- barrier(); >- wait_for_completion(&xfsbufd_done); >- >+ kthread_stop(xfsbufd_task); > destroy_workqueue(xfslogd_workqueue); > destroy_workqueue(xfsdatad_workqueue); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 113237
: 47757