diff options
author | Peter Mamonov <pmamonov@gmail.com> | 2015-10-13 14:26:23 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-10-13 16:06:31 +0200 |
commit | a7bbbe0236cd45c35bf79b4bdc628177e183791e (patch) | |
tree | b5924ba40e8851e699d5ad79d50e360ee9b67162 /fs | |
parent | 54bf38665024f797518726d0ecf612c3cf50e4d9 (diff) | |
download | barebox-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |