From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713AbaIBQYj (ORCPT ); Tue, 2 Sep 2014 12:24:39 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:33701 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752831AbaIBQYi (ORCPT ); Tue, 2 Sep 2014 12:24:38 -0400 Message-ID: <5405EF48.9070601@kernel.dk> Date: Tue, 02 Sep 2014 10:24:40 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ming Lei , linux-kernel@vger.kernel.org CC: Kick In , Chris J Arges Subject: Re: [PATCH] blk-merge: fix blk_recount_segments References: <1409670180-17352-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1409670180-17352-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02/2014 09:02 AM, Ming Lei wrote: > QUEUE_FLAG_NO_SG_MERGE is set at default for blk-mq devices, > so bio->bi_phys_segment computed may be bigger than > queue_max_segments(q) for blk-mq devices, then drivers will > fail to handle the case, for example, BUG_ON() in > virtio_queue_rq() can be triggerd for virtio-blk: > > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1359146 > > This patch fixes the issue by ignoring the QUEUE_FLAG_NO_SG_MERGE > flag if the computed bio->bi_phys_segment is bigger than > queue_max_segments(q), and the regression is caused by commit > 05f1dd53152173(block: add queue flag for disabling SG merging). > > Reported-by: Kick In > Tested-by: Chris J Arges > Signed-off-by: Ming Lei Thanks Ming, this looks nice and clean. Will apply for 3.17. -- Jens Axboe