summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-03-17 10:25:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-17 10:25:49 +0100
commit7dc73d3618a15f0d858d5409574f38f9f83905ef (patch)
treef862fe8bfb04919212bba6680768ac3ec37c8a4c /common
parent6381efc255dc3736f40f85b08339e3942afa62ef (diff)
downloadbarebox-7dc73d3618a15f0d858d5409574f38f9f83905ef.tar.gz
barebox-7dc73d3618a15f0d858d5409574f38f9f83905ef.tar.xz
blspec: Check if already mounted before mounting
cdev_mount_default() either mounts a cdev and returns the path it's mounted to or directly returns the path when it already is mounted. This will change in the next patch: When the cdev is already mounted cdev_mount_default() will return -EBUSY instead. To let blspec work when a cdev is already mounted check for the actual mount path before trying to mount it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/blspec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/blspec.c b/common/blspec.c
index c05d8a8297..ad80d7a8cd 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -729,7 +729,9 @@ static int blspec_scan_cdev(struct bootentries *bootentries, struct cdev *cdev)
found += ret;
}
- rootpath = cdev_mount_default(cdev, NULL);
+ rootpath = cdev_get_mount_path(cdev);
+ if (!rootpath)
+ rootpath = cdev_mount_default(cdev, NULL);
if (!IS_ERR(rootpath)) {
ret = blspec_scan_directory(bootentries, rootpath);
if (ret > 0)