From ef8619044b57cdb96bd5049a759c242b68fe2267 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Mon, 28 Sep 2009 21:10:12 +0200 Subject: [PATCH] --- yaml --- r: 174345 b: refs/heads/master c: 9722324e65a017ea0ce39236a2f87c649bb7c39d h: refs/heads/master i: 174343: c451672ba41c030bb982f927709de0bc5cd696ef v: v3 --- [refs] | 2 +- trunk/fs/ubifs/super.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index ac800f82ed74..ae267a7b3b93 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b57102841846d9840dcb1b8b308f6d7369b8e5c5 +refs/heads/master: 9722324e65a017ea0ce39236a2f87c649bb7c39d diff --git a/trunk/fs/ubifs/super.c b/trunk/fs/ubifs/super.c index 333e181ee987..943ad5624530 100644 --- a/trunk/fs/ubifs/super.c +++ b/trunk/fs/ubifs/super.c @@ -1842,22 +1842,32 @@ const struct super_operations ubifs_super_operations = { * @name: UBI volume name * @mode: UBI volume open mode * - * There are several ways to specify UBI volumes when mounting UBIFS: - * o ubiX_Y - UBI device number X, volume Y; - * o ubiY - UBI device number 0, volume Y; + * The primary method of mounting UBIFS is by specifying the UBI volume + * character device node path. However, UBIFS may also be mounted withoug any + * character device node using one of the following methods: + * + * o ubiX_Y - mount UBI device number X, volume Y; + * o ubiY - mount UBI device number 0, volume Y; * o ubiX:NAME - mount UBI device X, volume with name NAME; * o ubi:NAME - mount UBI device 0, volume with name NAME. * * Alternative '!' separator may be used instead of ':' (because some shells * like busybox may interpret ':' as an NFS host name separator). This function - * returns ubi volume object in case of success and a negative error code in - * case of failure. + * returns UBI volume description object in case of success and a negative + * error code in case of failure. */ static struct ubi_volume_desc *open_ubi(const char *name, int mode) { + struct ubi_volume_desc *ubi; int dev, vol; char *endptr; + /* First, try to open using the device node path method */ + ubi = ubi_open_volume_path(name, mode); + if (!IS_ERR(ubi)) + return ubi; + + /* Try the "nodev" method */ if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') return ERR_PTR(-EINVAL);