From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/4] fs: devfs: Allow mounting only on /dev/
Date: Tue, 13 Oct 2015 09:51:51 +0200 [thread overview]
Message-ID: <1444722714-30445-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1444722714-30445-1-git-send-email-s.hauer@pengutronix.de>
We have places in the code where we assume that devfs is mounted on
/dev/, so enforce this path to avoid surprises.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/devfs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/devfs.c b/fs/devfs.c
index c6db25c..5c96682 100644
--- a/fs/devfs.c
+++ b/fs/devfs.c
@@ -228,6 +228,13 @@ static int devfs_stat(struct device_d *_dev, const char *filename, struct stat *
static int devfs_probe(struct device_d *dev)
{
+ struct fs_device_d *fsdev = dev_to_fs_device(dev);
+
+ if (strcmp(fsdev->path, "/dev")) {
+ dev_err(dev, "devfs can only be mounted on /dev/\n");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.6.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-10-13 7:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 7:51 devfs fixes Sascha Hauer
2015-10-13 7:51 ` Sascha Hauer [this message]
2015-10-13 7:51 ` [PATCH 2/4] fs: devfs: Allow mount path in cdev_open Sascha Hauer
2015-10-13 8:25 ` Sascha Hauer
2015-10-13 7:51 ` [PATCH 3/4] filetype: Use cdev_open Sascha Hauer
2015-10-13 7:51 ` [PATCH 4/4] fs: pass path directly to cdev_open Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444722714-30445-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox