diff mbox

[OpenWrt-Devel] libfstools: "lowerdir" variable name in fopivot

Message ID CANyJPAEVB8r7MHWAfJ0eCfrTL-3SDDMm3uLumrrnxo26FBX6aA@mail.gmail.com
State Changes Requested
Delegated to: John Crispin
Headers show

Commit Message

Преподобный Гомер Aug. 17, 2016, 11:51 a.m. UTC
Hi all!

In fopivot in libfstools variable name "lowerdir" is confusing and
doesn't make any sense.
There is a patch renaming that var to "mount_options".
--
Regards,
R.H.

Comments

Преподобный Гомер Aug. 18, 2016, 12:02 p.m. UTC | #1
ping?
--
Regards,
R.H.


2016-08-17 14:51 GMT+03:00 Преподобный Гомер <mk.43.ecko@gmail.com>:
> Hi all!
>
> In fopivot in libfstools variable name "lowerdir" is confusing and
> doesn't make any sense.
> There is a patch renaming that var to "mount_options".
> --
> Regards,
> R.H.
John Crispin Aug. 18, 2016, 1:50 p.m. UTC | #2
pushed to the fstools master tree



On 18/08/2016 14:02, Преподобный Гомер wrote:
> ping?
> --
> Regards,
> R.H.
> 
> 
> 2016-08-17 14:51 GMT+03:00 Преподобный Гомер <mk.43.ecko@gmail.com>:
>> Hi all!
>>
>> In fopivot in libfstools variable name "lowerdir" is confusing and
>> doesn't make any sense.
>> There is a patch renaming that var to "mount_options".
>> --
>> Regards,
>> R.H.
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
diff mbox

Patch

From 5b591293a8734485c57f85b3a602b72f501e078e Mon Sep 17 00:00:00 2001
From: Reverend Homer <mk.43.ecko@gmail.com>
Date: Wed, 17 Aug 2016 14:47:06 +0300
Subject: [PATCH] libfstools: Rename "lowerdir" to "mount_options" in fopivot

---
 libfstools/mount.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libfstools/mount.c b/libfstools/mount.c
index 81176ce..371082b 100644
--- a/libfstools/mount.c
+++ b/libfstools/mount.c
@@ -82,7 +82,7 @@  pivot(char *new, char *old)
 int
 fopivot(char *rw_root, char *ro_root)
 {
-	char overlay[64], lowerdir[64];
+	char overlay[64], mount_options[64];
 
 	if (find_filesystem("overlay")) {
 		ULOG_ERR("BUG: no suitable fs found\n");
@@ -96,8 +96,8 @@  fopivot(char *rw_root, char *ro_root)
 	 * If it fails, it means that we are probably using a v23 and
 	 * later versions that require a workdir
 	 */
-	snprintf(lowerdir, sizeof(lowerdir), "lowerdir=/,upperdir=%s", rw_root);
-	if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, lowerdir)) {
+	snprintf(mount_options, sizeof(mount_options), "lowerdir=/,upperdir=%s", rw_root);
+	if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, mount_options)) {
 		char upperdir[64], workdir[64], upgrade[64], upgrade_dest[64];
 		struct stat st;
 
@@ -105,7 +105,7 @@  fopivot(char *rw_root, char *ro_root)
 		snprintf(workdir, sizeof(workdir), "%s/work", rw_root);
 		snprintf(upgrade, sizeof(upgrade), "%s/sysupgrade.tgz", rw_root);
 		snprintf(upgrade_dest, sizeof(upgrade_dest), "%s/sysupgrade.tgz", upperdir);
-		snprintf(lowerdir, sizeof(lowerdir), "lowerdir=/,upperdir=%s,workdir=%s",
+		snprintf(mount_options, sizeof(mount_options), "lowerdir=/,upperdir=%s,workdir=%s",
 			 upperdir, workdir);
 
 		/*
@@ -122,10 +122,10 @@  fopivot(char *rw_root, char *ro_root)
 		    rename(upgrade, upgrade_dest);
 
 		/* Mainlined overlayfs has been renamed to "overlay", try that first */
-		if (mount(overlay, "/mnt", "overlay", MS_NOATIME, lowerdir)) {
-			if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, lowerdir)) {
+		if (mount(overlay, "/mnt", "overlay", MS_NOATIME, mount_options)) {
+			if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, mount_options)) {
 				ULOG_ERR("mount failed: %s, options %s\n",
-				         strerror(errno), lowerdir);
+				         strerror(errno), mount_options);
 				return -1;
 			}
 		}
-- 
2.7.4