[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH 2/11] bottom-layer barrier support



If barrier request was returned with DM_ENDIO_REQUEUE,
requeue it in dm_wq_work instead of dec_pending.

Signed-off-by: Mikulas Patocka <mpatocka redhat com>

---
 drivers/md/dm.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Index: linux-2.6.30-rc1-devel/drivers/md/dm.c
===================================================================
--- linux-2.6.30-rc1-devel.orig/drivers/md/dm.c	2009-04-10 06:33:17.000000000 +0200
+++ linux-2.6.30-rc1-devel/drivers/md/dm.c	2009-04-10 06:33:20.000000000 +0200
@@ -547,9 +547,10 @@ static void dec_pending(struct dm_io *io
 			 * Target requested pushing back the I/O.
 			 */
 			spin_lock_irqsave(&md->deferred_lock, flags);
-			if (__noflush_suspending(md))
-				bio_list_add_head(&md->deferred, io->bio);
-			else
+			if (__noflush_suspending(md)) {
+				if (!bio_barrier(io->bio))
+					bio_list_add_head(&md->deferred, io->bio);
+			} else
 				/* noflush suspend was interrupted. */
 				io->error = -EIO;
 			spin_unlock_irqrestore(&md->deferred_lock, flags);
@@ -1470,6 +1471,11 @@ static void dm_wq_work(struct work_struc
 
 			if (md->barrier_error != DM_ENDIO_REQUEUE)
 				bio_endio(c, md->barrier_error);
+			else {
+				spin_lock_irq(&md->deferred_lock);
+				bio_list_add_head(&md->deferred, c);
+				spin_unlock_irq(&md->deferred_lock);
+			}
 		}
 
 next_bio:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]