]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ubifs: allow userspace to map mounts to volumes
authorRabin Vincent <rabinv@axis.com>
Wed, 31 May 2017 09:40:27 +0000 (11:40 +0200)
committerRichard Weinberger <richard@nod.at>
Fri, 14 Jul 2017 20:49:07 +0000 (22:49 +0200)
commit319c10427498620d220931189dcdba7d4244feba
treec71a55321e009fb633e7ac6e170627265485d8fe
parenta02a6eba9999221b27c691330e93bb54e4b45bb0
ubifs: allow userspace to map mounts to volumes

There currently appears to be no way for userspace to find out the
underlying volume number for a mounted ubifs file system, since ubifs
uses anonymous block devices.  The volume name is present in
/proc/mounts but UBI volumes can be renamed after the volume has been
mounted.

To remedy this, show the UBI number and UBI volume number as part of the
options visible under /proc/mounts.

Also, accept and ignore the ubi= vol= options if they are used mounting
(patch from Richard Weinberger).

 # mount -t ubifs ubi:baz x
 # mount
 ubi:baz on /root/x type ubifs (rw,relatime,ubi=0,vol=2)
 # ubirename /dev/ubi0 baz bazz
 # mount
 ubi:baz on /root/x type ubifs (rw,relatime,ubi=0,vol=2)
 # ubinfo -d 0 -n 2
 Volume ID:   2 (on ubi0)
 Type:        dynamic
 Alignment:   1
 Size:        67 LEBs (1063424 bytes, 1.0 MiB)
 State:       OK
 Name:        bazz
 Character device major/minor: 254:3

Signed-off-by: Rabin Vincent <rabinv@axis.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/super.c