Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427159AbdD3FtD (ORCPT ); Sun, 30 Apr 2017 01:49:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51468 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424400AbdD3Fsw (ORCPT ); Sun, 30 Apr 2017 01:48:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0E5D2C056792 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mchristi@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0E5D2C056792 Subject: Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area feature support To: lixiubo@cmss.chinamobile.com, 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> 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: <59057AC0.2090804@redhat.com> Date: Sun, 30 Apr 2017 00:48:48 -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: <1493187952-13125-2-git-send-email-lixiubo@cmss.chinamobile.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 30 Apr 2017 05:48:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 755 Lines: 17 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.