public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Brian Foster <brian.foster@maxim-ic.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: [BUG v1.4.6] `ubinfo -a' confused about non-consecutive UBI device numbers
Date: Tue, 24 Jan 2012 10:24:22 +0100	[thread overview]
Message-ID: <201201241024.22372.brian.foster@maxim-ic.com> (raw)


Hello,

 Using mtd-utils v1.4.6 with a v2.6.36 Linux kernel,
 if I have non-consecutive UBI device numbers (in the
 example below, ‘ubi0’ and ‘ubi10’), then ‘ubinfo -a’,
 after printing the info for ‘ubi0’, errors with:

    ubinfo: error!: cannot get information about UBI device 1
            error 2 (No such file or directory)

 In case it matters, ‘ubi0’ was attached/mounted by
 kernel command-line (it's my rootfs).  My normal
 practice is for manually attached MTD and UBI device
 numbers to be the same (with 12(!) MTD devices this
 greatly reduces confusion!).

─────────────────────────────────────────────────────
# ubinfo --version
1.1
# 
# ubinfo -a		# Only `ubi0' (rootfs) is attached...
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:63
Present UBI devices:            ubi0

ubi0
Volumes count:                           1
[...]
# 
# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 02000000 00020000 "physmap-flash.0"
mtd1: 00004000 00000001 "maximasp-nvram"
mtd2: 00002000 00000001 "maximasp-snvram"
mtd3: 00200000 00020000 "u-boot"
mtd4: 00080000 00020000 "env0"
mtd5: 00080000 00020000 "env1"
mtd6: 00400000 00020000 "kernel0"
mtd7: 00400000 00020000 "kernel1"
mtd8: 00500000 00020000 "kernel2"
mtd9: 06400000 00020000 "root0"
mtd10: 06400000 00020000 "root1"
mtd11: 12800000 00020000 "other"
# 
# ubiattach -m10 -d10	# Now attach `mtd10' as `ubi10'...
UBI device number 10, total 800 LEBs (103219200 bytes, 98.4 MiB), \
   available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
# 
# ubinfo -a		# `ubinfo -a' is now confused...
UBI version:                    1
Count of UBI devices:           2
UBI control device major/minor: 10:63
Present UBI devices:            ubi0, ubi10

ubi0
Volumes count:                           1
[...]

===================================

ubinfo: error!: cannot get information about UBI device 1
        error 2 (No such file or directory)
#
# ubinfo -d10		# However, `ubinfo -d10' is happy...
ubi10
Volumes count:                           1
[...]
# 
─────────────────────────────────────────────────────

 Notice that ‘ubinfo -a’ is fully and correctly aware of
 the attached devices, listing only ‘ubi0’ and ‘ubi10’.
 Nonetheless, it tries to print information about/from
 the non-existent ‘ubi1’.

 I have not investigated, nor tried other/recent versions.

cheers!
	-blf-

-- 
Brian Foster
Principal MTS, Software        |  La Ciotat, France
Maxim Integrated Products      |  Web:  http://www.maxim-ic.com/

             reply	other threads:[~2012-01-24  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24  9:24 Brian Foster [this message]
2012-01-24 20:16 ` [BUG v1.4.6] `ubinfo -a' confused about non-consecutive UBI device numbers Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201201241024.22372.brian.foster@maxim-ic.com \
    --to=brian.foster@maxim-ic.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox