fixup! detect_fs: use device instead of file
PATCH 1/1 fixup! detect_fs: use device instead of file
--- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fs.c +1 -1
@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL(register_fs_driver);static const char *detect_fs (const char *filename) { -enum filetype type =cdev_detect_type (filename); +enum filetype type =cdev_detect_type (basename (filename));struct driver_d *drv;struct fs_driver_d *fdrv;
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 9 lines · Peter Mamonov
--- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fs.c +0
-0
fs/fs.c EXPORT_SYMBOL(register_fs_driver); · line 1204
Quoted 5 lines
fs/fs.c +1
-1@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL(register_fs_driver);static const char *detect_fs (const char *filename) { -enum filetype type =cdev_detect_type (filename); +enum filetype type =cdev_detect_type (basename (filename));
basename is not so nice since we do not know whether the the part of the path we drop is really what we expect. Can we rather have a:
if (!strncmp(filename, "/dev/", 5)) filename += 5;
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 19 lines · On Fri, 9 Oct 2015 08:31:49 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 9 lines · Peter Mamonov
--- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fs.c +0
-0fs/fs.c EXPORT_SYMBOL(register_fs_driver); · line 1204
Quoted 5 lines
fs/fs.c +1
-1@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL(register_fs_driver);static const char *detect_fs (const char *filename) { -enum filetype type =cdev_detect_type (filename); +enum filetype type =cdev_detect_type (basename (filename));basename is not so nice since we do not know whether the the part of the path we drop is really what we expect. Can we rather have a:
Quoted 2 lines
if (!strncmp(filename, "/dev/", 5)) filename += 5;
What if devfs is mounted somehere else (not on /dev)?
Let me clarify the situation. After applying "detect_fs: use device instead of file" the mount command becomes completely broken for me, since detect_fs() is supplied with the full path to the device file, while cdev_by_name() expects device file name rather than full path:
static const char *detect_fs(const char *filename)
{
enum filetype type = cdev_detect_type(filename);
...
if (type == filetype_unknown)
return NULL;
...
}
struct cdev *cdev_by_name(const char *filename)
{
struct cdev *cdev;
list_for_each_entry(cdev, &cdev_list, list) {
if (!strcmp(cdev->name, filename)) <<<<<<< NO MATCH
return cdev;
}
return NULL;
}
struct cdev {
...
char *name; /* filename under /dev/ */
...
}Can you explain how could it work for Vicente:
http://lists.infradead.org/pipermail/barebox/2015-October/024832.html
?
Peter
Quoted 4 lines
Sascha
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 22 lines · Peter Mamonov
Quoted 19 lines · On Fri, 9 Oct 2015 08:31:49 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 9 lines · Peter Mamonov
--- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fs.c +0
-0fs/fs.c EXPORT_SYMBOL(register_fs_driver); · line 1204
Quoted 5 lines
fs/fs.c +1
-1@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL(register_fs_driver);static const char *detect_fs (const char *filename) { -enum filetype type =cdev_detect_type (filename); +enum filetype type =cdev_detect_type (basename (filename));basename is not so nice since we do not know whether the the part of the path we drop is really what we expect. Can we rather have a:
Quoted 4 lines
Quoted 2 lines
if (!strncmp(filename, "/dev/", 5)) filename += 5;What if devfs is mounted somehere else (not on /dev)?
Hm, Let's erm, consider that not supported ;)
We already have some places where we expect devfs mounted to /dev/. Not particularly nice I must admit.
Quoted 30 lines
Let me clarify the situation. After applying "
detect_fs: use device instead of file" the mount command becomes completely broken for me, sincedetect_fs()is supplied with the full path to the device file, whilecdev_by_name()expects device file name rather than full path:static const char *detect_fs(const char *filename)
{ enum filetype type = cdev_detect_type(filename); ... if (type == filetype_unknown) return NULL; ... } struct cdev *cdev_by_name(const char *filename) { struct cdev *cdev; list_for_each_entry(cdev, &cdev_list, list) { if (!strcmp(cdev->name, filename)) <<<<<<< NO MATCH return cdev; } return NULL; } struct cdev { ... char *name; /* filename under /dev/ */ ... }
Quoted 3 lines
Can you explain how could it work for Vicente:
http://lists.infradead.org/pipermail/barebox/2015-October/024832.html
?
Presumely He passes the device name (without /dev/) to mount.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 62 lines · Sascha Hauer
Quoted 22 lines · Peter Mamonov
Quoted 19 lines · On Fri, 9 Oct 2015 08:31:49 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 9 lines · Peter Mamonov
--- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fs.c +0
-0fs/fs.c EXPORT_SYMBOL(register_fs_driver); · line 1204
Quoted 5 lines
fs/fs.c +1
-1@@ -1201,7 +1201,7 @@ EXPORT_SYMBOL(register_fs_driver);static const char *detect_fs (const char *filename) { -enum filetype type =cdev_detect_type (filename); +enum filetype type =cdev_detect_type (basename (filename));basename is not so nice since we do not know whether the the part of the path we drop is really what we expect. Can we rather have a:
Quoted 4 lines
Quoted 2 lines
if (!strncmp(filename, "/dev/", 5)) filename += 5;What if devfs is mounted somehere else (not on /dev)?
Hm, Let's erm, consider that not supported ;)
We already have some places where we expect devfs mounted to/dev/. Not particularly nice I must admit.Quoted 30 lines
Let me clarify the situation. After applying "
detect_fs: use device instead of file" the mount command becomes completely broken for me, sincedetect_fs()is supplied with the full path to the device file, whilecdev_by_name()expects device file name rather than full path:static const char *detect_fs(const char *filename)
{ enum filetype type = cdev_detect_type(filename); ... if (type == filetype_unknown) return NULL; ... } struct cdev *cdev_by_name(const char *filename) { struct cdev *cdev; list_for_each_entry(cdev, &cdev_list, list) { if (!strcmp(cdev->name, filename)) <<<<<<< NO MATCH return cdev; } return NULL; } struct cdev { ... char *name; /* filename under /dev/ */ ... }
Quoted 5 lines
Quoted 3 lines
Can you explain how could it work for Vicente:
http://lists.infradead.org/pipermail/barebox/2015-October/024832.html
?Presumely He passes the device name (without
/dev/) to mount.
Yes, that is correct, from
http://git.pengutronix.de/?p=barebox.git;a=blob;f=arch/arm/mach-omap/xload.c#l104
what is mount is just the partition name.
The only thing is that it is not me, that was already there.
Regards,
Vicente.
Quoted 8 lines
Sascha
--
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox