aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ubifs/super.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 333e181ee987..943ad5624530 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1842,22 +1842,32 @@ const struct super_operations ubifs_super_operations = {
1842 * @name: UBI volume name 1842 * @name: UBI volume name
1843 * @mode: UBI volume open mode 1843 * @mode: UBI volume open mode
1844 * 1844 *
1845 * There are several ways to specify UBI volumes when mounting UBIFS: 1845 * The primary method of mounting UBIFS is by specifying the UBI volume
1846 * o ubiX_Y - UBI device number X, volume Y; 1846 * character device node path. However, UBIFS may also be mounted withoug any
1847 * o ubiY - UBI device number 0, volume Y; 1847 * character device node using one of the following methods:
1848 *
1849 * o ubiX_Y - mount UBI device number X, volume Y;
1850 * o ubiY - mount UBI device number 0, volume Y;
1848 * o ubiX:NAME - mount UBI device X, volume with name NAME; 1851 * o ubiX:NAME - mount UBI device X, volume with name NAME;
1849 * o ubi:NAME - mount UBI device 0, volume with name NAME. 1852 * o ubi:NAME - mount UBI device 0, volume with name NAME.
1850 * 1853 *
1851 * Alternative '!' separator may be used instead of ':' (because some shells 1854 * Alternative '!' separator may be used instead of ':' (because some shells
1852 * like busybox may interpret ':' as an NFS host name separator). This function 1855 * like busybox may interpret ':' as an NFS host name separator). This function
1853 * returns ubi volume object in case of success and a negative error code in 1856 * returns UBI volume description object in case of success and a negative
1854 * case of failure. 1857 * error code in case of failure.
1855 */ 1858 */
1856static struct ubi_volume_desc *open_ubi(const char *name, int mode) 1859static struct ubi_volume_desc *open_ubi(const char *name, int mode)
1857{ 1860{
1861 struct ubi_volume_desc *ubi;
1858 int dev, vol; 1862 int dev, vol;
1859 char *endptr; 1863 char *endptr;
1860 1864
1865 /* First, try to open using the device node path method */
1866 ubi = ubi_open_volume_path(name, mode);
1867 if (!IS_ERR(ubi))
1868 return ubi;
1869
1870 /* Try the "nodev" method */
1861 if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') 1871 if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i')
1862 return ERR_PTR(-EINVAL); 1872 return ERR_PTR(-EINVAL);
1863 1873