[PATCH] ubi: Do "dump_stack()" in case of the ubi_io_read()/ubi_io_write()/do_sync_erase() has an error

Mark xiaoming1981.zhang at gmail.com
Mon Apr 23 08:31:41 EDT 2012


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 <mark.zhang at motorola.com>
---
  drivers/mtd/ubi/io.c |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)

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;
  	}

@@ -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;
  	}




More information about the linux-mtd mailing list