Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp437714imm; Tue, 7 Aug 2018 22:50:45 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxh28NFMTMkL0pwLsS4pIVOL3oDGZaYQsetB6ItEn7XadYiDcfCXLq5QoaG35wz4HwbhMvl X-Received: by 2002:a65:428b:: with SMTP id j11-v6mr1157446pgp.200.1533707445792; Tue, 07 Aug 2018 22:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533707445; cv=none; d=google.com; s=arc-20160816; b=0GNWb13/JP9EPRZgvFo1gu8q1jj1mD+nlwJQg3qtH0AcayU2QX8jih1b6ZaQAuQwk+ cnMwykE8btUf6HipyAeeNbo2l5Rgdodd0FqfBXC/QHpxXGdxSDOWuyjA2NwOztxuqKjm BTc44Ips/nuivXr3RtsBLTHzdmhvd5ISKNwVFnL3HAEskYovrgqO2gvYpnNpUuTPK6YG so/yqBfkkKFzETQfDttKRgirfFmtshXqGPrqovjg9UJAEB7zKCsh4povzfPHnTY31zxd 5mfh2MnYLzI94XwnYEkMq1Gxe9WubdDutM+dfvwqAjMTLGRim77IV6qCDd/PsSs5QrcZ bkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=dQtkCkA/n1TQCRH412Nq8j+5MIXqBqcbAF6qjSVwPx4=; b=UFja7Rf61/Kl8hGaEKViPhroh2QFteEpCCRRCHuITjfOEbRpHYxkEfs7q0xX+eEGGb nstdk4mD5xvWZyUu4Dx0SNu2CC2sjxIbnSvLDszL4WhSKfTHNjNLv2iEzaa/z4N0lO1X Bl5FtAhkAprYkpPkw424gIq1W/t23ySWXfO6icWGLTuFnH7qjISvlz9ZfYAPm4YmXhei mxznxEBj4m42Gssr2jzIx9SMa8GbtvYhLKz5jJYeto3nuUrAIhhZyfnRopCGLoZ0YFER BIdDuiBbsSy+VsvmkQtKwiQ6Po531LaVEWTXgQMpVt4HSCz3KT88zaZxxNIEMYVDIwzg 0xpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22-v6si2669534plk.512.2018.08.07.22.50.30; Tue, 07 Aug 2018 22:50:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbeHHIHk (ORCPT + 99 others); Wed, 8 Aug 2018 04:07:40 -0400 Received: from mga06.intel.com ([134.134.136.31]:40101 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeHHIHj (ORCPT ); Wed, 8 Aug 2018 04:07:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 22:49:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="81597466" Received: from unknown (HELO [10.239.154.226]) ([10.239.154.226]) by orsmga002.jf.intel.com with ESMTP; 07 Aug 2018 22:49:38 -0700 Subject: Re: [PATCH] dm-bufio: adjust the reserved buffer for dm-verify-target. To: Greg KH References: <1533704823-5448-1-git-send-email-jin.xiao@intel.com> <20180808052514.GA20034@kroah.com> Cc: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, yanmin.zhang@intel.com From: xiaojin Message-ID: <5B6A84E4.2020805@intel.com> Date: Wed, 8 Aug 2018 13:51:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20180808052514.GA20034@kroah.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018年08月08日 13:25, Greg KH wrote: > On Wed, Aug 08, 2018 at 01:07:03PM +0800, xiao jin wrote: >> We hit the BUG() report at include/linux/scatterlist.h:144! >> The callback is as bellow: >> => verity_work >> => verity_hash_for_block >> => verity_verify_level >> => verity_hash >> => verity_hash_update >> => sg_init_one >> => sg_set_buf >> >> More debug shows the root cause. When creating dufio client it >> uses the __vmalloc() to allocate the buffer data for the reserved >> dm_buffer. The buffer that allocated by the __vmalloc() is invalid >> according to the __virt_addr_valid(). >> >> Mostly the reserved dm_buffer is not touched. But occasionally >> it might fail to allocate the dm_buffer data when we try to >> allocate in the __alloc_buffer_wait_no_callback(). Then it has >> to take the reserved dm_buffer for usage. Finally it reports the >> BUG() as virt_addr_valid() detects the buffer data address is invalid. >> >> The patch is to adjust the reserved buffer for dm-verity-target. We >> allocated two dm_buffers into the reserved buffers list when creating >> the buffer interface. The first dm_buffer in the reserved buffer list >> is allocated by the __vmalloc(), it's not used after that. The second >> dm_buffer in the reserved buffer list is allocated by the >> __get_free_pages() which can be consumed after that. >> >> Signed-off-by: xiao jin >> --- >> drivers/md/dm-bufio.c | 4 ++-- >> drivers/md/dm-verity-target.c | 2 +- >> 2 files changed, 3 insertions(+), 3 deletions(-) >> > > > This is not the correct way to submit patches for inclusion in the > stable kernel tree. Please read: > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html > for how to do this properly. > > Thanks, I will resend to review without the stable mail list.