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

* Re: dm: check error instead of r in clone_endio
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Snitzer @ 2014-12-17 17:34 UTC (permalink / raw)
  To: alex chen; +Cc: device-mapper development, Joseph Qi

On Wed, Dec 17 2014 at  1:37am -0500,
alex chen <alex.chen@huawei.com> wrote:

> 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>

I've fixed it a bit differently (clone_endio now matches dm_done) and
have staged it for 3.19, see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=5164bece1673cdf04782f8ed3fba70743700f5da

Thanks.

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

* Re: dm: check error instead of r in clone_endio
  2014-12-17 17:34 ` Mike Snitzer
@ 2014-12-18  1:41   ` alex chen
  0 siblings, 0 replies; 3+ messages in thread
From: alex chen @ 2014-12-18  1:41 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: device-mapper development, Joseph Qi


On 2014/12/18 1:34, Mike Snitzer wrote:
> On Wed, Dec 17 2014 at  1:37am -0500,
> alex chen <alex.chen@huawei.com> wrote:
> 
>> 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>
> 
> I've fixed it a bit differently (clone_endio now matches dm_done) and
> have staged it for 3.19, see:
> https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=5164bece1673cdf04782f8ed3fba70743700f5da
> 
> Thanks.

OK, thank you!
> 
> 

^ permalink raw reply	[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.