From: alex chen <alex.chen@huawei.com>
To: device-mapper development <dm-devel@redhat.com>,
Mike Snitzer <snitzer@redhat.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Subject: [PATCH] dm: check error instead of r in clone_endio
Date: Wed, 17 Dec 2014 14:37:04 +0800 [thread overview]
Message-ID: <54912490.8030808@huawei.com> (raw)
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
next reply other threads:[~2014-12-17 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 6:37 alex chen [this message]
2014-12-17 17:34 ` dm: check error instead of r in clone_endio Mike Snitzer
2014-12-18 1:41 ` alex chen
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=54912490.8030808@huawei.com \
--to=alex.chen@huawei.com \
--cc=dm-devel@redhat.com \
--cc=joseph.qi@huawei.com \
--cc=snitzer@redhat.com \
/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.