All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Liu Bo <bo.li.liu@oracle.com>,
	Chris Mason <clm@fb.com>
Subject: [PATCH 3.16 091/125] Btrfs: fix task hang under heavy compressed write
Date: Wed,  3 Sep 2014 15:07:28 -0700	[thread overview]
Message-ID: <20140903220626.407074930@linuxfoundation.org> (raw)
In-Reply-To: <20140903220623.649748296@linuxfoundation.org>

3.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Liu Bo <bo.li.liu@oracle.com>

commit 9e0af23764344f7f1b68e4eefbe7dc865018b63d upstream.

This has been reported and discussed for a long time, and this hang occurs in
both 3.15 and 3.16.

Btrfs now migrates to use kernel workqueue, but it introduces this hang problem.

Btrfs has a kind of work queued as an ordered way, which means that its
ordered_func() must be processed in the way of FIFO, so it usually looks like --

normal_work_helper(arg)
    work = container_of(arg, struct btrfs_work, normal_work);

    work->func() <---- (we name it work X)
    for ordered_work in wq->ordered_list
            ordered_work->ordered_func()
            ordered_work->ordered_free()

The hang is a rare case, first when we find free space, we get an uncached block
group, then we go to read its free space cache inode for free space information,
so it will

file a readahead request
    btrfs_readpages()
         for page that is not in page cache
                __do_readpage()
                     submit_extent_page()
                           btrfs_submit_bio_hook()
                                 btrfs_bio_wq_end_io()
                                 submit_bio()
                                 end_workqueue_bio() <--(ret by the 1st endio)
                                      queue a work(named work Y) for the 2nd
                                      also the real endio()

So the hang occurs when work Y's work_struct and work X's work_struct happens
to share the same address.

A bit more explanation,

A,B,C -- struct btrfs_work
arg   -- struct work_struct

kthread:
worker_thread()
    pick up a work_struct from @worklist
    process_one_work(arg)
	worker->current_work = arg;  <-- arg is A->normal_work
	worker->current_func(arg)
		normal_work_helper(arg)
		     A = container_of(arg, struct btrfs_work, normal_work);

		     A->func()
		     A->ordered_func()
		     A->ordered_free()  <-- A gets freed

		     B->ordered_func()
			  submit_compressed_extents()
			      find_free_extent()
				  load_free_space_inode()
				      ...   <-- (the above readhead stack)
				      end_workqueue_bio()
					   btrfs_queue_work(work C)
		     B->ordered_free()

As if work A has a high priority in wq->ordered_list and there are more ordered
works queued after it, such as B->ordered_func(), its memory could have been
freed before normal_work_helper() returns, which means that kernel workqueue
code worker_thread() still has worker->current_work pointer to be work
A->normal_work's, ie. arg's address.

Meanwhile, work C is allocated after work A is freed, work C->normal_work
and work A->normal_work are likely to share the same address(I confirmed this
with ftrace output, so I'm not just guessing, it's rare though).

When another kthread picks up work C->normal_work to process, and finds our
kthread is processing it(see find_worker_executing_work()), it'll think
work C as a collision and skip then, which ends up nobody processing work C.

So the situation is that our kthread is waiting forever on work C.

Besides, there're other cases that can lead to deadlock, but the real problem
is that all btrfs workqueue shares one work->func, -- normal_work_helper,
so this makes each workqueue to have its own helper function, but only a
wraper pf normal_work_helper.

With this patch, I no long hit the above hang.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/btrfs/async-thread.c  |   44 +++++++++++++++++++++++++++++++--------
 fs/btrfs/async-thread.h  |   28 +++++++++++++++++++++++-
 fs/btrfs/delayed-inode.c |    4 +--
 fs/btrfs/disk-io.c       |   53 +++++++++++++++++++++++++----------------------
 fs/btrfs/extent-tree.c   |    7 +++---
 fs/btrfs/inode.c         |   35 ++++++++++++++++++++-----------
 fs/btrfs/ordered-data.c  |    1 
 fs/btrfs/qgroup.c        |    1 
 fs/btrfs/raid56.c        |    9 +++++--
 fs/btrfs/reada.c         |    3 +-
 fs/btrfs/scrub.c         |   14 +++++++-----
 fs/btrfs/volumes.c       |    3 +-
 12 files changed, 141 insertions(+), 61 deletions(-)

--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -22,7 +22,6 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/freezer.h>
-#include <linux/workqueue.h>
 #include "async-thread.h"
 #include "ctree.h"
 
@@ -55,8 +54,39 @@ struct btrfs_workqueue {
 	struct __btrfs_workqueue *high;
 };
 
-static inline struct __btrfs_workqueue
-*__btrfs_alloc_workqueue(const char *name, int flags, int max_active,
+static void normal_work_helper(struct btrfs_work *work);
+
+#define BTRFS_WORK_HELPER(name)					\
+void btrfs_##name(struct work_struct *arg)				\
+{									\
+	struct btrfs_work *work = container_of(arg, struct btrfs_work,	\
+					       normal_work);		\
+	normal_work_helper(work);					\
+}
+
+BTRFS_WORK_HELPER(worker_helper);
+BTRFS_WORK_HELPER(delalloc_helper);
+BTRFS_WORK_HELPER(flush_delalloc_helper);
+BTRFS_WORK_HELPER(cache_helper);
+BTRFS_WORK_HELPER(submit_helper);
+BTRFS_WORK_HELPER(fixup_helper);
+BTRFS_WORK_HELPER(endio_helper);
+BTRFS_WORK_HELPER(endio_meta_helper);
+BTRFS_WORK_HELPER(endio_meta_write_helper);
+BTRFS_WORK_HELPER(endio_raid56_helper);
+BTRFS_WORK_HELPER(rmw_helper);
+BTRFS_WORK_HELPER(endio_write_helper);
+BTRFS_WORK_HELPER(freespace_write_helper);
+BTRFS_WORK_HELPER(delayed_meta_helper);
+BTRFS_WORK_HELPER(readahead_helper);
+BTRFS_WORK_HELPER(qgroup_rescan_helper);
+BTRFS_WORK_HELPER(extent_refs_helper);
+BTRFS_WORK_HELPER(scrub_helper);
+BTRFS_WORK_HELPER(scrubwrc_helper);
+BTRFS_WORK_HELPER(scrubnc_helper);
+
+static struct __btrfs_workqueue *
+__btrfs_alloc_workqueue(const char *name, int flags, int max_active,
 			 int thresh)
 {
 	struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
@@ -232,13 +262,11 @@ static void run_ordered_work(struct __bt
 	spin_unlock_irqrestore(lock, flags);
 }
 
-static void normal_work_helper(struct work_struct *arg)
+static void normal_work_helper(struct btrfs_work *work)
 {
-	struct btrfs_work *work;
 	struct __btrfs_workqueue *wq;
 	int need_order = 0;
 
-	work = container_of(arg, struct btrfs_work, normal_work);
 	/*
 	 * We should not touch things inside work in the following cases:
 	 * 1) after work->func() if it has no ordered_free
@@ -262,7 +290,7 @@ static void normal_work_helper(struct wo
 		trace_btrfs_all_work_done(work);
 }
 
-void btrfs_init_work(struct btrfs_work *work,
+void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func,
 		     btrfs_func_t func,
 		     btrfs_func_t ordered_func,
 		     btrfs_func_t ordered_free)
@@ -270,7 +298,7 @@ void btrfs_init_work(struct btrfs_work *
 	work->func = func;
 	work->ordered_func = ordered_func;
 	work->ordered_free = ordered_free;
-	INIT_WORK(&work->normal_work, normal_work_helper);
+	INIT_WORK(&work->normal_work, uniq_func);
 	INIT_LIST_HEAD(&work->ordered_list);
 	work->flags = 0;
 }
--- a/fs/btrfs/async-thread.h
+++ b/fs/btrfs/async-thread.h
@@ -19,12 +19,14 @@
 
 #ifndef __BTRFS_ASYNC_THREAD_
 #define __BTRFS_ASYNC_THREAD_
+#include <linux/workqueue.h>
 
 struct btrfs_workqueue;
 /* Internal use only */
 struct __btrfs_workqueue;
 struct btrfs_work;
 typedef void (*btrfs_func_t)(struct btrfs_work *arg);
+typedef void (*btrfs_work_func_t)(struct work_struct *arg);
 
 struct btrfs_work {
 	btrfs_func_t func;
@@ -38,11 +40,35 @@ struct btrfs_work {
 	unsigned long flags;
 };
 
+#define BTRFS_WORK_HELPER_PROTO(name)					\
+void btrfs_##name(struct work_struct *arg)
+
+BTRFS_WORK_HELPER_PROTO(worker_helper);
+BTRFS_WORK_HELPER_PROTO(delalloc_helper);
+BTRFS_WORK_HELPER_PROTO(flush_delalloc_helper);
+BTRFS_WORK_HELPER_PROTO(cache_helper);
+BTRFS_WORK_HELPER_PROTO(submit_helper);
+BTRFS_WORK_HELPER_PROTO(fixup_helper);
+BTRFS_WORK_HELPER_PROTO(endio_helper);
+BTRFS_WORK_HELPER_PROTO(endio_meta_helper);
+BTRFS_WORK_HELPER_PROTO(endio_meta_write_helper);
+BTRFS_WORK_HELPER_PROTO(endio_raid56_helper);
+BTRFS_WORK_HELPER_PROTO(rmw_helper);
+BTRFS_WORK_HELPER_PROTO(endio_write_helper);
+BTRFS_WORK_HELPER_PROTO(freespace_write_helper);
+BTRFS_WORK_HELPER_PROTO(delayed_meta_helper);
+BTRFS_WORK_HELPER_PROTO(readahead_helper);
+BTRFS_WORK_HELPER_PROTO(qgroup_rescan_helper);
+BTRFS_WORK_HELPER_PROTO(extent_refs_helper);
+BTRFS_WORK_HELPER_PROTO(scrub_helper);
+BTRFS_WORK_HELPER_PROTO(scrubwrc_helper);
+BTRFS_WORK_HELPER_PROTO(scrubnc_helper);
+
 struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
 					      int flags,
 					      int max_active,
 					      int thresh);
-void btrfs_init_work(struct btrfs_work *work,
+void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t helper,
 		     btrfs_func_t func,
 		     btrfs_func_t ordered_func,
 		     btrfs_func_t ordered_free);
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1395,8 +1395,8 @@ static int btrfs_wq_run_delayed_node(str
 		return -ENOMEM;
 
 	async_work->delayed_root = delayed_root;
-	btrfs_init_work(&async_work->work, btrfs_async_run_delayed_root,
-			NULL, NULL);
+	btrfs_init_work(&async_work->work, btrfs_delayed_meta_helper,
+			btrfs_async_run_delayed_root, NULL, NULL);
 	async_work->nr = nr;
 
 	btrfs_queue_work(root->fs_info->delayed_workers, &async_work->work);
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -39,7 +39,6 @@
 #include "btrfs_inode.h"
 #include "volumes.h"
 #include "print-tree.h"
-#include "async-thread.h"
 #include "locking.h"
 #include "tree-log.h"
 #include "free-space-cache.h"
@@ -693,35 +692,41 @@ static void end_workqueue_bio(struct bio
 {
 	struct end_io_wq *end_io_wq = bio->bi_private;
 	struct btrfs_fs_info *fs_info;
+	struct btrfs_workqueue *wq;
+	btrfs_work_func_t func;
 
 	fs_info = end_io_wq->info;
 	end_io_wq->error = err;
-	btrfs_init_work(&end_io_wq->work, end_workqueue_fn, NULL, NULL);
 
 	if (bio->bi_rw & REQ_WRITE) {
-		if (end_io_wq->metadata == BTRFS_WQ_ENDIO_METADATA)
-			btrfs_queue_work(fs_info->endio_meta_write_workers,
-					 &end_io_wq->work);
-		else if (end_io_wq->metadata == BTRFS_WQ_ENDIO_FREE_SPACE)
-			btrfs_queue_work(fs_info->endio_freespace_worker,
-					 &end_io_wq->work);
-		else if (end_io_wq->metadata == BTRFS_WQ_ENDIO_RAID56)
-			btrfs_queue_work(fs_info->endio_raid56_workers,
-					 &end_io_wq->work);
-		else
-			btrfs_queue_work(fs_info->endio_write_workers,
-					 &end_io_wq->work);
+		if (end_io_wq->metadata == BTRFS_WQ_ENDIO_METADATA) {
+			wq = fs_info->endio_meta_write_workers;
+			func = btrfs_endio_meta_write_helper;
+		} else if (end_io_wq->metadata == BTRFS_WQ_ENDIO_FREE_SPACE) {
+			wq = fs_info->endio_freespace_worker;
+			func = btrfs_freespace_write_helper;
+		} else if (end_io_wq->metadata == BTRFS_WQ_ENDIO_RAID56) {
+			wq = fs_info->endio_raid56_workers;
+			func = btrfs_endio_raid56_helper;
+		} else {
+			wq = fs_info->endio_write_workers;
+			func = btrfs_endio_write_helper;
+		}
 	} else {
-		if (end_io_wq->metadata == BTRFS_WQ_ENDIO_RAID56)
-			btrfs_queue_work(fs_info->endio_raid56_workers,
-					 &end_io_wq->work);
-		else if (end_io_wq->metadata)
-			btrfs_queue_work(fs_info->endio_meta_workers,
-					 &end_io_wq->work);
-		else
-			btrfs_queue_work(fs_info->endio_workers,
-					 &end_io_wq->work);
+		if (end_io_wq->metadata == BTRFS_WQ_ENDIO_RAID56) {
+			wq = fs_info->endio_raid56_workers;
+			func = btrfs_endio_raid56_helper;
+		} else if (end_io_wq->metadata) {
+			wq = fs_info->endio_meta_workers;
+			func = btrfs_endio_meta_helper;
+		} else {
+			wq = fs_info->endio_workers;
+			func = btrfs_endio_helper;
+		}
 	}
+
+	btrfs_init_work(&end_io_wq->work, func, end_workqueue_fn, NULL, NULL);
+	btrfs_queue_work(wq, &end_io_wq->work);
 }
 
 /*
@@ -828,7 +833,7 @@ int btrfs_wq_submit_bio(struct btrfs_fs_
 	async->submit_bio_start = submit_bio_start;
 	async->submit_bio_done = submit_bio_done;
 
-	btrfs_init_work(&async->work, run_one_async_start,
+	btrfs_init_work(&async->work, btrfs_worker_helper, run_one_async_start,
 			run_one_async_done, run_one_async_free);
 
 	async->bio_flags = bio_flags;
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -552,7 +552,8 @@ static int cache_block_group(struct btrf
 	caching_ctl->block_group = cache;
 	caching_ctl->progress = cache->key.objectid;
 	atomic_set(&caching_ctl->count, 1);
-	btrfs_init_work(&caching_ctl->work, caching_thread, NULL, NULL);
+	btrfs_init_work(&caching_ctl->work, btrfs_cache_helper,
+			caching_thread, NULL, NULL);
 
 	spin_lock(&cache->lock);
 	/*
@@ -2749,8 +2750,8 @@ int btrfs_async_run_delayed_refs(struct
 		async->sync = 0;
 	init_completion(&async->wait);
 
-	btrfs_init_work(&async->work, delayed_ref_async_start,
-			NULL, NULL);
+	btrfs_init_work(&async->work, btrfs_extent_refs_helper,
+			delayed_ref_async_start, NULL, NULL);
 
 	btrfs_queue_work(root->fs_info->extent_workers, &async->work);
 
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1096,8 +1096,10 @@ static int cow_file_range_async(struct i
 		async_cow->end = cur_end;
 		INIT_LIST_HEAD(&async_cow->extents);
 
-		btrfs_init_work(&async_cow->work, async_cow_start,
-				async_cow_submit, async_cow_free);
+		btrfs_init_work(&async_cow->work,
+				btrfs_delalloc_helper,
+				async_cow_start, async_cow_submit,
+				async_cow_free);
 
 		nr_pages = (cur_end - start + PAGE_CACHE_SIZE) >>
 			PAGE_CACHE_SHIFT;
@@ -1881,7 +1883,8 @@ static int btrfs_writepage_start_hook(st
 
 	SetPageChecked(page);
 	page_cache_get(page);
-	btrfs_init_work(&fixup->work, btrfs_writepage_fixup_worker, NULL, NULL);
+	btrfs_init_work(&fixup->work, btrfs_fixup_helper,
+			btrfs_writepage_fixup_worker, NULL, NULL);
 	fixup->page = page;
 	btrfs_queue_work(root->fs_info->fixup_workers, &fixup->work);
 	return -EBUSY;
@@ -2822,7 +2825,8 @@ static int btrfs_writepage_end_io_hook(s
 	struct inode *inode = page->mapping->host;
 	struct btrfs_root *root = BTRFS_I(inode)->root;
 	struct btrfs_ordered_extent *ordered_extent = NULL;
-	struct btrfs_workqueue *workers;
+	struct btrfs_workqueue *wq;
+	btrfs_work_func_t func;
 
 	trace_btrfs_writepage_end_io_hook(page, start, end, uptodate);
 
@@ -2831,13 +2835,17 @@ static int btrfs_writepage_end_io_hook(s
 					    end - start + 1, uptodate))
 		return 0;
 
-	btrfs_init_work(&ordered_extent->work, finish_ordered_fn, NULL, NULL);
+	if (btrfs_is_free_space_inode(inode)) {
+		wq = root->fs_info->endio_freespace_worker;
+		func = btrfs_freespace_write_helper;
+	} else {
+		wq = root->fs_info->endio_write_workers;
+		func = btrfs_endio_write_helper;
+	}
 
-	if (btrfs_is_free_space_inode(inode))
-		workers = root->fs_info->endio_freespace_worker;
-	else
-		workers = root->fs_info->endio_write_workers;
-	btrfs_queue_work(workers, &ordered_extent->work);
+	btrfs_init_work(&ordered_extent->work, func, finish_ordered_fn, NULL,
+			NULL);
+	btrfs_queue_work(wq, &ordered_extent->work);
 
 	return 0;
 }
@@ -7158,7 +7166,8 @@ again:
 	if (!ret)
 		goto out_test;
 
-	btrfs_init_work(&ordered->work, finish_ordered_fn, NULL, NULL);
+	btrfs_init_work(&ordered->work, btrfs_endio_write_helper,
+			finish_ordered_fn, NULL, NULL);
 	btrfs_queue_work(root->fs_info->endio_write_workers,
 			 &ordered->work);
 out_test:
@@ -8485,7 +8494,9 @@ struct btrfs_delalloc_work *btrfs_alloc_
 	work->inode = inode;
 	work->wait = wait;
 	work->delay_iput = delay_iput;
-	btrfs_init_work(&work->work, btrfs_run_delalloc_work, NULL, NULL);
+	WARN_ON_ONCE(!inode);
+	btrfs_init_work(&work->work, btrfs_flush_delalloc_helper,
+			btrfs_run_delalloc_work, NULL, NULL);
 
 	return work;
 }
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -615,6 +615,7 @@ int btrfs_wait_ordered_extents(struct bt
 		spin_unlock(&root->ordered_extent_lock);
 
 		btrfs_init_work(&ordered->flush_work,
+				btrfs_flush_delalloc_helper,
 				btrfs_run_ordered_extent_work, NULL, NULL);
 		list_add_tail(&ordered->work_list, &works);
 		btrfs_queue_work(root->fs_info->flush_workers,
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2551,6 +2551,7 @@ qgroup_rescan_init(struct btrfs_fs_info
 	memset(&fs_info->qgroup_rescan_work, 0,
 	       sizeof(fs_info->qgroup_rescan_work));
 	btrfs_init_work(&fs_info->qgroup_rescan_work,
+			btrfs_qgroup_rescan_helper,
 			btrfs_qgroup_rescan_worker, NULL, NULL);
 
 	if (ret) {
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1416,7 +1416,8 @@ cleanup:
 
 static void async_rmw_stripe(struct btrfs_raid_bio *rbio)
 {
-	btrfs_init_work(&rbio->work, rmw_work, NULL, NULL);
+	btrfs_init_work(&rbio->work, btrfs_rmw_helper,
+			rmw_work, NULL, NULL);
 
 	btrfs_queue_work(rbio->fs_info->rmw_workers,
 			 &rbio->work);
@@ -1424,7 +1425,8 @@ static void async_rmw_stripe(struct btrf
 
 static void async_read_rebuild(struct btrfs_raid_bio *rbio)
 {
-	btrfs_init_work(&rbio->work, read_rebuild_work, NULL, NULL);
+	btrfs_init_work(&rbio->work, btrfs_rmw_helper,
+			read_rebuild_work, NULL, NULL);
 
 	btrfs_queue_work(rbio->fs_info->rmw_workers,
 			 &rbio->work);
@@ -1665,7 +1667,8 @@ static void btrfs_raid_unplug(struct blk
 	plug = container_of(cb, struct btrfs_plug_cb, cb);
 
 	if (from_schedule) {
-		btrfs_init_work(&plug->work, unplug_work, NULL, NULL);
+		btrfs_init_work(&plug->work, btrfs_rmw_helper,
+				unplug_work, NULL, NULL);
 		btrfs_queue_work(plug->info->rmw_workers,
 				 &plug->work);
 		return;
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -798,7 +798,8 @@ static void reada_start_machine(struct b
 		/* FIXME we cannot handle this properly right now */
 		BUG();
 	}
-	btrfs_init_work(&rmw->work, reada_start_machine_worker, NULL, NULL);
+	btrfs_init_work(&rmw->work, btrfs_readahead_helper,
+			reada_start_machine_worker, NULL, NULL);
 	rmw->fs_info = fs_info;
 
 	btrfs_queue_work(fs_info->readahead_workers, &rmw->work);
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -428,8 +428,8 @@ struct scrub_ctx *scrub_setup_ctx(struct
 		sbio->index = i;
 		sbio->sctx = sctx;
 		sbio->page_count = 0;
-		btrfs_init_work(&sbio->work, scrub_bio_end_io_worker,
-				NULL, NULL);
+		btrfs_init_work(&sbio->work, btrfs_scrub_helper,
+				scrub_bio_end_io_worker, NULL, NULL);
 
 		if (i != SCRUB_BIOS_PER_SCTX - 1)
 			sctx->bios[i]->next_free = i + 1;
@@ -999,8 +999,8 @@ nodatasum_case:
 		fixup_nodatasum->root = fs_info->extent_root;
 		fixup_nodatasum->mirror_num = failed_mirror_index + 1;
 		scrub_pending_trans_workers_inc(sctx);
-		btrfs_init_work(&fixup_nodatasum->work, scrub_fixup_nodatasum,
-				NULL, NULL);
+		btrfs_init_work(&fixup_nodatasum->work, btrfs_scrub_helper,
+				scrub_fixup_nodatasum, NULL, NULL);
 		btrfs_queue_work(fs_info->scrub_workers,
 				 &fixup_nodatasum->work);
 		goto out;
@@ -1616,7 +1616,8 @@ static void scrub_wr_bio_end_io(struct b
 	sbio->err = err;
 	sbio->bio = bio;
 
-	btrfs_init_work(&sbio->work, scrub_wr_bio_end_io_worker, NULL, NULL);
+	btrfs_init_work(&sbio->work, btrfs_scrubwrc_helper,
+			 scrub_wr_bio_end_io_worker, NULL, NULL);
 	btrfs_queue_work(fs_info->scrub_wr_completion_workers, &sbio->work);
 }
 
@@ -3203,7 +3204,8 @@ static int copy_nocow_pages(struct scrub
 	nocow_ctx->len = len;
 	nocow_ctx->mirror_num = mirror_num;
 	nocow_ctx->physical_for_dev_replace = physical_for_dev_replace;
-	btrfs_init_work(&nocow_ctx->work, copy_nocow_pages_worker, NULL, NULL);
+	btrfs_init_work(&nocow_ctx->work, btrfs_scrubnc_helper,
+			copy_nocow_pages_worker, NULL, NULL);
 	INIT_LIST_HEAD(&nocow_ctx->inodes);
 	btrfs_queue_work(fs_info->scrub_nocow_workers,
 			 &nocow_ctx->work);
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5800,7 +5800,8 @@ struct btrfs_device *btrfs_alloc_device(
 	else
 		generate_random_uuid(dev->uuid);
 
-	btrfs_init_work(&dev->work, pending_bios_fn, NULL, NULL);
+	btrfs_init_work(&dev->work, btrfs_submit_helper,
+			pending_bios_fn, NULL, NULL);
 
 	return dev;
 }



  parent reply	other threads:[~2014-09-03 22:27 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 22:05 [PATCH 3.16 000/125] 3.16.2-stable review Greg Kroah-Hartman
2014-09-03 22:05 ` [PATCH 3.16 001/125] stable_kernel_rules: Add pointer to netdev-FAQ for network patches Greg Kroah-Hartman
2014-09-03 22:05 ` [PATCH 3.16 002/125] MIPS: math-emu: Fix instruction decoding Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 003/125] HID: logitech: fix bounds checking on LED report size Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 004/125] HID: logitech: perform bounds checking on device_id early enough Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 005/125] HID: fix a couple of off-by-ones Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 006/125] isofs: Fix unbounded recursion when processing relocated directories Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 007/125] uas: Limit qdepth to 32 when connected over usb-2 Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 008/125] USB: OHCI: fix bugs in debug routines Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 009/125] USB: OHCI: dont lose track of EDs when a controller dies Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 010/125] usbcore: dont log on consecutive debounce failures of the same port Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 011/125] USB: devio: fix issue with log flooding Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 012/125] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 013/125] USB: serial: ftdi_sio: Add support for new Xsens devices Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 014/125] USB: ehci-pci: USB host controller support for Intel Quark X1000 Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 015/125] USB: Fix persist resume of some SS USB devices Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 016/125] ALSA: hda - fix an external mic jack problem on a HP machine Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 017/125] ALSA: usb-audio: Adjust Gamecom 780 volume level Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 018/125] ALSA: virtuoso: add Xonar Essence STX II support Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 019/125] ALSA: hda/ca0132 - Dont try loading firmware at resume when already failed Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 020/125] ALSA: usb-audio: fix BOSS ME-25 MIDI regression Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 021/125] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 022/125] ALSA: hda - restore the gpio led after resume Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 023/125] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 024/125] mei: reset client connection state on timeout Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 025/125] mei: start disconnect request timer consistently Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 026/125] mei: dont schedule suspend in pm idle Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 027/125] mei: fix return value on disconnect timeout Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 028/125] xhci: Blacklist using streams on the Etron EJ168 controller Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 029/125] sched: Fix sched_setparam() policy == -1 logic Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 030/125] arm64: Fix barriers used for page table modifications Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 031/125] arm64: dont call break hooks for BRK exceptions from EL0 Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 032/125] efi/arm64: Store Runtime Services revision Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 033/125] ARM: dts: AM4372: Correct mailbox node data Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 034/125] ARM: 8097/1: unistd.h: relocate comments back to place Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 036/125] drm: omapdrm: fix compiler errors Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 037/125] mmc: mmci: Remove redundant check of status for DATA irq Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 038/125] mmc: mmci: Move all CMD irq handling to mmci_cmd_irq() Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 039/125] hwmon: (sis5595) Prevent overflow problem when writing large limits Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 040/125] hwmon: (amc6821) Fix possible race condition bug Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 041/125] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 042/125] hwmon: (gpio-fan) Prevent overflow problem when writing large limits Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 043/125] hwmon: (ads1015) Fix off-by-one for valid channel index checking Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 044/125] hwmon: (lm85) Fix various errors on attribute writes Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 045/125] hwmon: (ads1015) Fix out-of-bounds array access Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 046/125] hwmon: (dme1737) Prevent overflow problem when writing large limits Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 047/125] hwmon: (lm92) " Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 048/125] tpm: Add missing tpm_do_selftest to ST33 I2C driver Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 049/125] drivers/i2c/busses: use correct type for dma_map/unmap Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 050/125] i2c: rk3x: fix interrupt handling issue Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 051/125] ext4: fix punch hole on files with indirect mapping Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 052/125] ext4: fix ext4_discard_allocated_blocks() if we cant allocate the pa struct Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 053/125] serial: core: Preserve termios c_cflag for console resume Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 054/125] crypto: ux500 - make interrupt mode plausible Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 055/125] debugfs: Fix corrupted loop in debugfs_remove_recursive Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 056/125] KVM: x86: Inter-privilege level ret emulation is not implemeneted Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 057/125] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 058/125] KVM: s390/mm: Fix page table locking vs. split pmd lock Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 059/125] KVM: PPC: Book3S: Fix LPCR one_reg interface Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 060/125] KVM: nVMX: fix "acknowledge interrupt on exit" when APICv is in use Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 061/125] Revert "KVM: x86: Increase the number of fixed MTRR regs to 10" Greg Kroah-Hartman
2014-09-03 22:06 ` [PATCH 3.16 062/125] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 063/125] ext4: fix BUG_ON in mb_free_blocks() Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 064/125] drm/radeon: add new KV pci id Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 065/125] drm/radeon: add new bonaire pci ids Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 066/125] drm/radeon: add additional SI " Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 067/125] PCI: Configure ASPM when enabling device Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 068/125] PCI: Keep original resource if we fail to expand it Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 069/125] PCI: pciehp: Clear Data Link Layer State Changed during init Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 070/125] ACPI / PCI: Fix sysfs acpi_index and label errors Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 071/125] x86: dont exclude low BIOS area when allocating address space for non-PCI cards Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 072/125] powerpc/eeh: Wrong place to call pci_get_slot() Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 073/125] powerpc/pci: Reorder pci bus/bridge unregistration during PHB removal Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 074/125] powerpc/powernv: Update dev->dma_mask in pci_set_dma_mask() path Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 075/125] x86_64/vsyscall: Fix warn_bad_vsyscall log output Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 076/125] hpsa: fix non-x86 builds Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 077/125] x86: MCE: Add raw_lock conversion again Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 078/125] xen/events/fifo: ensure all bitops are properly aligned even on x86 Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 080/125] x86/xen: use vmap() to map grant table pages in PVH guests Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 081/125] x86/xen: resume timer irqs early Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 082/125] x86,mm: fix pte_special versus pte_numa Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 083/125] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 084/125] Btrfs: Fix memory corruption by ulist_add_merge() on 32bit arch Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 085/125] Btrfs: fix csum tree corruption, duplicate and outdated checksums Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 086/125] Btrfs: read lock extent buffer while walking backrefs Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 087/125] Btrfs: fix compressed write corruption on enospc Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 088/125] btrfs: disable strict file flushes for renames and truncates Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 089/125] Btrfs: fix crash on endio of reading corrupted block Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 090/125] Btrfs: fix filemap_flush call in btrfs_file_release Greg Kroah-Hartman
2014-09-03 22:07 ` Greg Kroah-Hartman [this message]
2014-09-03 22:07 ` [PATCH 3.16 092/125] mei: reset client state on queued connect request Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 093/125] mei: nfc: fix memory leak in error path Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 094/125] ext4: propagate errors up to ext4_find_entry()s callers Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 095/125] ext4: move i_size,i_disksize update routines to helper function Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 096/125] ext4: fix incorect journal credits reservation in ext4_zero_range Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 097/125] ext4: fix transaction issues for ext4_fallocate and ext_zero_range Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 098/125] ext4: update i_disksize coherently with block allocation on error path Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 099/125] ext4: fix same-dir rename when inline data directory overflows Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 100/125] jbd2: fix infinite loop when recovering corrupt journal blocks Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 101/125] jbd2: fix descriptor block size handling errors with journal_csum Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 102/125] staging: lustre: Remove circular dependency on header Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 103/125] staging: et131x: Fix errors caused by phydev->addr accesses before initialisation Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 104/125] staging/rtl8188eu: add 0df6:0076 Sitecom Europe B.V Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 105/125] staging: r8188eu: Add new USB ID Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 106/125] xhci: Treat not finding the event_seg on COMP_STOP the same as COMP_STOP_INVAL Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 107/125] usb: xhci: amd chipset also needs short TX quirk Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 108/125] xhci: rework cycle bit checking for new dequeue pointers Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 109/125] xhci: Disable streams on Via XHCI with device-id 0x3432 Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 110/125] ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 111/125] USB: ftdi_sio: add Basic Micro ATOM Nano USB2Serial PID Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 113/125] USB: whiteheat: Added bounds checking for bulk command response Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 114/125] usb: ehci: using wIndex + 1 for hub port Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 115/125] usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1 Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 116/125] usbcore: Fix wrong device in an error message in hub_port_connect() Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 117/125] NFSD: Decrease nfsd_users in nfsd_startup_generic fail Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 118/125] NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 119/125] nfs3_list_one_acl(): check get_acl() result with IS_ERR_OR_NULL Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 120/125] nfs: reject changes to resvport and sharecache during remount Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 121/125] svcrdma: Select NFSv4.1 backchannel transport based on forward channel Greg Kroah-Hartman
2014-09-03 22:07 ` [PATCH 3.16 122/125] NFSv3: Fix another acl regression Greg Kroah-Hartman
2014-09-03 22:08 ` [PATCH 3.16 123/125] NFSv4: Dont clear the open state when we just did an OPEN_DOWNGRADE Greg Kroah-Hartman
2014-09-03 22:08 ` [PATCH 3.16 124/125] NFSv4: Fix problems with close in the presence of a delegation Greg Kroah-Hartman
2014-09-03 22:08 ` [PATCH 3.16 125/125] vm_is_stack: use for_each_thread() rather then buggy while_each_thread() Greg Kroah-Hartman
2014-09-03 23:44 ` [PATCH 3.16 000/125] 3.16.2-stable review Greg Kroah-Hartman
2014-09-04  4:52   ` Guenter Roeck
2014-09-04 13:40 ` Shuah Khan
2014-09-04 14:00   ` Greg Kroah-Hartman

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=20140903220626.407074930@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bo.li.liu@oracle.com \
    --cc=clm@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.