From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751551AbdEAShr (ORCPT ); Mon, 1 May 2017 14:37:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53444 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbdEAShp (ORCPT ); Mon, 1 May 2017 14:37:45 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AD64129B58B Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mchristi@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AD64129B58B Subject: Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area featuresupport To: Xiubo Li , nab@linux-iscsi.org References: <1493187952-13125-1-git-send-email-lixiubo@cmss.chinamobile.com> <1493187952-13125-2-git-send-email-lixiubo@cmss.chinamobile.com> <59057AC0.2090804@redhat.com> <5f6a28f7-62ab-1096-625c-c42db78af99d@cmss.chinamobile.com> Cc: agrover@redhat.com, iliastsi@arrikto.com, namei.unix@gmail.com, sheng@yasker.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Jianfei Hu From: Mike Christie Message-ID: <59078075.3090309@redhat.com> Date: Mon, 1 May 2017 13:37:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <5f6a28f7-62ab-1096-625c-c42db78af99d@cmss.chinamobile.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 01 May 2017 18:37:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/30/2017 05:22 AM, Xiubo Li wrote: > On 2017年04月30日 13:48, Mike Christie wrote: >> On 04/26/2017 01:25 AM, lixiubo@cmss.chinamobile.com wrote: >>> for_each_sg(data_sg, sg, data_nents, i) { >>> @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_area(struct >>> tcmu_dev *udev, >>> from = kmap_atomic(sg_page(sg)) + sg->offset; >>> while (sg_remaining > 0) { >>> if (block_remaining == 0) { >>> - block = find_first_zero_bit(udev->data_bitmap, >>> - DATA_BLOCK_BITS); >>> block_remaining = DATA_BLOCK_SIZE; >>> - set_bit(block, udev->data_bitmap); >>> + dbi = tcmu_get_empty_block(udev, &to); >>> + if (dbi < 0) >> >> I know it you fixed the missing kunmap_atomic here and missing unlock in >> tcmu_queue_cmd_ring in the next patch, but I think normally people >> prefer that one patch does not add a bug, then the next patch fixes it. > Do you mean the following kmap_atomic() ? > > from = kmap_atomic(sg_page(sg)) + sg->offset; > > In this patch there has no new kmap/kunmap introduced. This is the old > code and > the kunmap is at the end of aasda(). You added a new return in the error path in this patch in the if case above, but did not add a kunmap_atomic.