summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPeter Mamonov <pmamonov@gmail.com>2015-10-13 14:26:23 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-13 16:06:31 +0200
commita7bbbe0236cd45c35bf79b4bdc628177e183791e (patch)
treeb5924ba40e8851e699d5ad79d50e360ee9b67162 /fs
parent54bf38665024f797518726d0ecf612c3cf50e4d9 (diff)
downloadbarebox-a7bbbe0236cd45c35bf79b4bdc628177e183791e.tar.gz
barebox-a7bbbe0236cd45c35bf79b4bdc628177e183791e.tar.xz
fs: Fix filesystem detection with full path
When mount is given a full path (including /dev/) to the cdev file we can no longer automatically detect the filesystem. This is broken since: e89f1a1 detect_fs: use device instead of file Fix it by dropping the /dev/ component of the path. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/fs.c b/fs/fs.c
index c041e41bb5..c2a20e17d7 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1201,10 +1201,14 @@ EXPORT_SYMBOL(register_fs_driver);
static const char *detect_fs(const char *filename)
{
- enum filetype type = cdev_detect_type(filename);
+ enum filetype type;
struct driver_d *drv;
struct fs_driver_d *fdrv;
+ if (!strncmp(filename, "/dev/", 5))
+ filename += 5;
+ type = cdev_detect_type(filename);
+
if (type == filetype_unknown)
return NULL;