From patchwork Tue Jan 12 06:49:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8014281 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CBE16BEEE5 for ; Tue, 12 Jan 2016 06:57:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0A7C20379 for ; Tue, 12 Jan 2016 06:57:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26421201F4 for ; Tue, 12 Jan 2016 06:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761306AbcALGvI (ORCPT ); Tue, 12 Jan 2016 01:51:08 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34429 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760757AbcALGt7 (ORCPT ); Tue, 12 Jan 2016 01:49:59 -0500 Received: by mail-wm0-f42.google.com with SMTP id u188so242524384wmu.1 for ; Mon, 11 Jan 2016 22:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=q/Z52nz32qRYvLDNbeE3XmDvUHDCxg+pg/mgqwlfUF0=; b=W0iUsMTquxL5VUdYp4I32nJ6wge9SiUcWbUjbe5TAiz4I04EGqJ7dwaK2kjalPKJz4 Y4GXofgC79HRSBiMNLUP01wZHvseUpfQrKDOnaMTZDoX9H2ngFlveX8I5qjqRIfSemMN j9yJlyivEng6kG2NYqmSg7r7Bdno2ZgmoJdPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=q/Z52nz32qRYvLDNbeE3XmDvUHDCxg+pg/mgqwlfUF0=; b=B/JW//jGHQhI1C3rufyu3CklzIytEb4Aa4abwud6gPfuz394szclioW0Taleq4u6y3 LytaMXFRJo1nN6FRh2dxJPG/NE8eMcaNQ4gRrJCcJEg1/QB0nPeYQsNmF455wS5XClpt S0IHdUCHK5OtxN63OhfD6P7BTdROpB7HhefB6fTVtDiAR/4dcrBqKXCvS2rv9w9OA/I5 1BIKxcV3hX/ybhsSs4+oh7VSpSGh/VtWDG244ZJ6km/2txfo+rvsrCdljCcEXY7cCJcS Q+uCvE0EvFNGijHgGAWziC2P3M4we4RNP3f0jDrB9n/0SOusSOL2Lvx4ZFoZfKnaGIY+ kyjA== X-Gm-Message-State: ALoCoQn3VpaISSNBbI+3T4892TUSiflW6Rxpw7VQSgxEkvPULvKDo0MBAH614tzokYmRi4RZadt715o1yGhxJcweZlstSB595A== X-Received: by 10.194.184.112 with SMTP id et16mr23097261wjc.124.1452581397866; Mon, 11 Jan 2016 22:49:57 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:49:57 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: Wenwei Tao , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 04/25] lightnvm: unlock rq and free ppa_list on submission fail Date: Tue, 12 Jan 2016 07:49:18 +0100 Message-Id: <1452581379-18162-5-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wenwei Tao When rrpc_write_ppalist_rq and rrpc_read_ppalist_rq succeed, we setup rq correctly, but nvm_submit_io may afterward fail since it cannot allocate request or nvme_nvm_command, we return error but forget to cleanup the previous work. Signed-off-by: Wenwei Tao Signed-off-by: Matias Bjørling --- drivers/lightnvm/rrpc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index f4bc986..748cab49 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -845,6 +845,12 @@ static int rrpc_submit_io(struct rrpc *rrpc, struct bio *bio, if (err) { pr_err("rrpc: I/O submission failed: %d\n", err); bio_put(bio); + if (!(flags & NVM_IOTYPE_GC)) { + rrpc_unlock_rq(rrpc, rqd); + if (rqd->nr_pages > 1) + nvm_dev_dma_free(rrpc->dev, + rqd->ppa_list, rqd->dma_ppa_list); + } return NVM_IO_ERR; }