From patchwork Mon Apr 23 12:31:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoming Zhang X-Patchwork-Id: 154416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D268DB6FDC for ; Mon, 23 Apr 2012 22:34:16 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SMIR9-0001ZY-V9; Mon, 23 Apr 2012 12:32:11 +0000 Received: from mail-pz0-f43.google.com ([209.85.210.43]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SMIR5-0001ZK-9u for linux-mtd@lists.infradead.org; Mon, 23 Apr 2012 12:32:10 +0000 Received: by dadn15 with SMTP id n15so18904907dad.16 for ; Mon, 23 Apr 2012 05:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-forwarded-message-id:content-type :content-transfer-encoding; bh=TykpDR0Ye0a9uZj6RcZZMeYhnocrfieCp4hnadmV08w=; b=fD53dqo0+CPlMgHVatMG58nXtlHkkNsoJC10dQd6G6mpdTCjk6hsbqeOpwzbxf0WCZ qw58/+Gw4x+QXi4mVIqPPJSeDUYhCIil/d1GGbQOeYg8TWi6vlUjxDPPhl4sL8JIGK0D Ms7Be7+6N2A3SgmM81GuSv2KXFaeSLzjZbPN/9EPMkaTLKctOQpixjzd4wHhUAOwgs57 UzZ4uG/HZs4vmIenoFxgF55CgzRX+vNyJDo3ATTDrlNLEfoPRCdvDSGxuPKZyP+0Ra8N +wsr/N3fDQv3HtJmTZqHx9+p560/5dKA2+LK0E8kyoKLmv0VaAZkwToNtFo2C+GgC+Dx 48BA== Received: by 10.68.204.9 with SMTP id ku9mr36176313pbc.1.1335184325654; Mon, 23 Apr 2012 05:32:05 -0700 (PDT) Received: from [192.168.1.3] ([115.199.216.218]) by mx.google.com with ESMTPS id r10sm14284245pbf.22.2012.04.23.05.32.02 (version=SSLv3 cipher=OTHER); Mon, 23 Apr 2012 05:32:05 -0700 (PDT) Message-ID: <4F954BAD.2010606@gmail.com> Date: Mon, 23 Apr 2012 20:31:41 +0800 From: Mark User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Artem Bityutskiy Subject: [PATCH] ubi: Do "dump_stack()" in case of the ubi_io_read()/ubi_io_write()/do_sync_erase() has an error References: In-Reply-To: X-Forwarded-Message-Id: X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.43 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (xiaoming1981.zhang[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-mtd , zxm927@163.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ubi: Do "dump_stack()" to always have the dump in case of the ubi_io_read()/ubi_io_write()/do_sync_erase() has an error. Signed-off-by: Mark Zhang --- drivers/mtd/ubi/io.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) @@ -293,7 +293,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, if (err) { ubi_err("error %d while writing %d bytes to PEB %d:%d, written " "%zd bytes", err, len, pnum, offset, written); - ubi_dbg_dump_stack(); + dump_stack(); ubi_dbg_dump_flash(ubi, pnum, offset, len); } else ubi_assert(written == len); @@ -370,7 +370,7 @@ retry: goto retry; } ubi_err("cannot erase PEB %d, error %d", pnum, err); - ubi_dbg_dump_stack(); + dump_stack(); return err; } @@ -388,7 +388,7 @@ retry: goto retry; } ubi_err("cannot erase PEB %d", pnum); - ubi_dbg_dump_stack(); + dump_stack(); return -EIO; } diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 43f1a00..4a866db 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -198,7 +198,7 @@ retry: ubi_err("error %d%s while reading %d bytes from PEB %d:%d, " "read %zd bytes", err, errstr, len, pnum, offset, read); - ubi_dbg_dump_stack(); + dump_stack(); /* * The driver should never return -EBADMSG if it failed to read @@ -284,7 +284,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, if (ubi_dbg_is_write_failure(ubi)) { dbg_err("cannot write %d bytes to PEB %d:%d " "(emulated)", len, pnum, offset); - ubi_dbg_dump_stack(); + dump_stack(); return -EIO; }