@@ -842,6 +842,19 @@ index 827643808..d98d58ec9 100644
842842 }
843843 static int
844844 dup2_or_raise(int from, int to)
845+ diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c
846+ index 4c30f31f8..a152d3a73 100644
847+ --- a/util-linux/fdisk_gpt.c
848+ +++ b/util-linux/fdisk_gpt.c
849+ @@ -108,7 +108,7 @@ gpt_list_table(int xtra UNUSED_PARAM)
850+ int i;
851+ char numstr6[6];
852+
853+ - smart_ulltoa5(total_number_of_sectors * sector_size, numstr6, " KMGTPEZY")[0] = '\0';
854+ + smart_ulltoa5((unsigned long long)total_number_of_sectors * (unsigned long long)sector_size, numstr6, " KMGTPEZY")[0] = '\0';
855+ printf("Disk %s: %llu sectors, %s\n", disk_device,
856+ (unsigned long long)total_number_of_sectors,
857+ numstr6);
845858diff --git a/util-linux/fsfreeze.c b/util-linux/fsfreeze.c
846859index 6e2ff0a54..6ba039890 100644
847860--- a/util-linux/fsfreeze.c
@@ -869,7 +882,7 @@ index 6d673002f..1f0ba5066 100644
869882 #ifndef FITRIM
870883 struct fstrim_range {
871884diff --git a/util-linux/mount.c b/util-linux/mount.c
872- index 4e65b6b46..08eff7a84 100644
885+ index 4e65b6b46..258ec69b2 100644
873886--- a/util-linux/mount.c
874887+++ b/util-linux/mount.c
875888@@ -255,9 +255,9 @@
@@ -885,15 +898,29 @@ index 4e65b6b46..08eff7a84 100644
885898 #endif
886899
887900
888- @@ -818,6 +818,7 @@ static int mount_it_now(struct mntent *mp, unsigned long vfsflags, char *filtero
901+ @@ -806,7 +806,13 @@ static int mount_it_now(struct mntent *mp, unsigned long vfsflags, char *filtero
902+ update_mtab_entry_on_move(mp);
903+ else
904+ #endif
905+ + {
906+ + if (mp->mnt_opts[0] == '\0')
907+ + {
908+ + append_mount_options(&(mp->mnt_opts), "rw");
909+ + }
910+ addmntent(mountTable, mp);
911+ + }
912+ endmntent(mountTable);
913+
914+ if (ENABLE_FEATURE_CLEAN_UP) {
915+ @@ -818,6 +824,7 @@ static int mount_it_now(struct mntent *mp, unsigned long vfsflags, char *filtero
889916 return rc;
890917 }
891918
892919+ #if 0
893920 #if ENABLE_FEATURE_MOUNT_NFS
894921
895922 /*
896- @@ -1912,6 +1913 ,8 @@ static int nfsmount(struct mntent *mp, unsigned long vfsflags, char *filteropts)
923+ @@ -1912,6 +1919 ,8 @@ static int nfsmount(struct mntent *mp, unsigned long vfsflags, char *filteropts)
897924
898925 #endif // !ENABLE_FEATURE_MOUNT_NFS
899926
@@ -902,27 +929,40 @@ index 4e65b6b46..08eff7a84 100644
902929 // Find "...,NAME=NUM,..." in the option string, remove "NAME=NUM" option
903930 // and return NUM.
904931 // Return 0 if not found.
905- @@ -2089,6 +2092 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
932+ @@ -2089,6 +2098 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
906933 }
907934
908935 // Might this be an NFS filesystem?
909936+ #if 0
910937 if (!(vfsflags & (MS_BIND | MS_MOVE))
911938 && (!mp->mnt_type || is_prefixed_with(mp->mnt_type, "nfs"))
912939 ) {
913- @@ -2102,6 +2106 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
940+ @@ -2102,6 +2112 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
914941 goto report_error;
915942 }
916943 }
917944+ #endif
918945
919946 // Look at the file. (Not found isn't a failure for remount, or for
920947 // a synthetic filesystem like proc or sysfs.)
921- @@ -2151,6 +2156 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
948+ @@ -2151,6 +2162 ,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
922949 // If we know the fstype (or don't need to), jump straight
923950 // to the actual mount.
924951 if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
925- +
952+ +
926953 char *next;
927954 for (;;) {
928955 next = mp->mnt_type ? strchr(mp->mnt_type, ',') : NULL;
956+ diff --git a/util-linux/umount.c b/util-linux/umount.c
957+ index 23da32868..18d5dea67 100644
958+ --- a/util-linux/umount.c
959+ +++ b/util-linux/umount.c
960+ @@ -169,6 +169,8 @@ int umount_main(int argc UNUSED_PARAM, char **argv)
961+ argv++;
962+ path = xmalloc_realpath(zapit);
963+ if (path) {
964+ + size_t length = strlen(path);
965+ + path[length - 1] = '\0';
966+ for (m = mtl; m; m = m->next)
967+ if (strcmp(path, m->dir) == 0 || strcmp(path, m->device) == 0)
968+ break;
0 commit comments