dm.c (3f77316de0ec0fd208467fbee8d9edc70e2c73b2) | dm.c (708e929513502fb050c0a3c3ee267cab5b056ded) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 625 unchanged lines hidden (view full) --- 634 io_error = io->error; 635 bio = io->bio; 636 637 if (bio->bi_rw & REQ_HARDBARRIER) { 638 /* 639 * There can be just one barrier request so we use 640 * a per-device variable for error reporting. 641 * Note that you can't touch the bio after end_io_acct | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 625 unchanged lines hidden (view full) --- 634 io_error = io->error; 635 bio = io->bio; 636 637 if (bio->bi_rw & REQ_HARDBARRIER) { 638 /* 639 * There can be just one barrier request so we use 640 * a per-device variable for error reporting. 641 * Note that you can't touch the bio after end_io_acct |
642 * 643 * We ignore -EOPNOTSUPP for empty flush reported by 644 * underlying devices. We assume that if the device 645 * doesn't support empty barriers, it doesn't need 646 * cache flushing commands. |
|
642 */ | 647 */ |
643 if (!md->barrier_error && io_error != -EOPNOTSUPP) | 648 if (!md->barrier_error && 649 !(bio_empty_barrier(bio) && io_error == -EOPNOTSUPP)) |
644 md->barrier_error = io_error; 645 end_io_acct(io); 646 free_io(md, io); 647 } else { 648 end_io_acct(io); 649 free_io(md, io); 650 651 if (io_error != DM_ENDIO_REQUEUE) { --- 1627 unchanged lines hidden (view full) --- 2279static void process_barrier(struct mapped_device *md, struct bio *bio) 2280{ 2281 md->barrier_error = 0; 2282 2283 dm_flush(md); 2284 2285 if (!bio_empty_barrier(bio)) { 2286 __split_and_process_bio(md, bio); | 650 md->barrier_error = io_error; 651 end_io_acct(io); 652 free_io(md, io); 653 } else { 654 end_io_acct(io); 655 free_io(md, io); 656 657 if (io_error != DM_ENDIO_REQUEUE) { --- 1627 unchanged lines hidden (view full) --- 2285static void process_barrier(struct mapped_device *md, struct bio *bio) 2286{ 2287 md->barrier_error = 0; 2288 2289 dm_flush(md); 2290 2291 if (!bio_empty_barrier(bio)) { 2292 __split_and_process_bio(md, bio); |
2287 dm_flush(md); | 2293 /* 2294 * If the request isn't supported, don't waste time with 2295 * the second flush. 2296 */ 2297 if (md->barrier_error != -EOPNOTSUPP) 2298 dm_flush(md); |
2288 } 2289 2290 if (md->barrier_error != DM_ENDIO_REQUEUE) 2291 bio_endio(bio, md->barrier_error); 2292 else { 2293 spin_lock_irq(&md->deferred_lock); 2294 bio_list_add_head(&md->deferred, bio); 2295 spin_unlock_irq(&md->deferred_lock); --- 519 unchanged lines hidden --- | 2299 } 2300 2301 if (md->barrier_error != DM_ENDIO_REQUEUE) 2302 bio_endio(bio, md->barrier_error); 2303 else { 2304 spin_lock_irq(&md->deferred_lock); 2305 bio_list_add_head(&md->deferred, bio); 2306 spin_unlock_irq(&md->deferred_lock); --- 519 unchanged lines hidden --- |