All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: check error instead of r in clone_endio
@ 2014-12-17  6:37 alex chen
  2014-12-17 17:34 ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: alex chen @ 2014-12-17  6:37 UTC (permalink / raw)
  To: device-mapper development, Mike Snitzer; +Cc: Joseph Qi

In the clone_endio, when target_type is linear and WRITE SAME bio
fails, r will be always be initialized 0 because of null end_io, and
in this case WRITE SAME will not be disabled.
So we should check error instead of r.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
---
 drivers/md/dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6aa2592..3642d10 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -791,7 +791,7 @@ static void clone_endio(struct bio *bio, int error)
 		}
 	}

-	if (unlikely(r == -EREMOTEIO && (bio->bi_rw & REQ_WRITE_SAME) &&
+	if (unlikely(error == -EREMOTEIO && (bio->bi_rw & REQ_WRITE_SAME) &&
 		     !bdev_get_queue(bio->bi_bdev)->limits.max_write_same_sectors))
 		disable_write_same(md);

-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-18  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17  6:37 [PATCH] dm: check error instead of r in clone_endio alex chen
2014-12-17 17:34 ` Mike Snitzer
2014-12-18  1:41   ` alex chen

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.