4af0c9f
From 09400b7f7f48d8eedc0df55de8073a43bc0aac96 Mon Sep 17 00:00:00 2001
4af0c9f
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
4af0c9f
Date: Tue, 27 Oct 2020 20:15:43 +0000
4af0c9f
Subject: [PATCH 1/2] stat,tail: sync file system constants from the linux
4af0c9f
 kernel
4af0c9f
4af0c9f
* src/stat.c: Add magic constants for "devmem", and
4af0c9f
"zonefs" file systems.
4af0c9f
* NEWS: Mention the improvement.
4af0c9f
4af0c9f
Upstream-commit: ff80b6b0a0507e24f39cc1aad09d147f5187430b
4af0c9f
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
4af0c9f
---
4af0c9f
 src/stat.c | 4 ++++
4af0c9f
 1 file changed, 4 insertions(+)
4af0c9f
4af0c9f
diff --git a/src/stat.c b/src/stat.c
4af0c9f
index 5012622..8cd69da 100644
4af0c9f
--- a/src/stat.c
4af0c9f
+++ b/src/stat.c
4af0c9f
@@ -347,6 +347,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
4af0c9f
       return "debugfs";
4af0c9f
     case S_MAGIC_DEVFS: /* 0x1373 local */
4af0c9f
       return "devfs";
4af0c9f
+    case S_MAGIC_DEVMEM: /* 0x454D444D local */
4af0c9f
+      return "devmem";
4af0c9f
     case S_MAGIC_DEVPTS: /* 0x1CD1 local */
4af0c9f
       return "devpts";
4af0c9f
     case S_MAGIC_DMA_BUF: /* 0x444D4142 local */
4af0c9f
@@ -549,6 +551,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
4af0c9f
       return "z3fold";
4af0c9f
     case S_MAGIC_ZFS: /* 0x2FC12FC1 local */
4af0c9f
       return "zfs";
4af0c9f
+    case S_MAGIC_ZONEFS: /* 0x5A4F4653 local */
4af0c9f
+      return "zonefs";
4af0c9f
     case S_MAGIC_ZSMALLOC: /* 0x58295829 local */
4af0c9f
       return "zsmallocfs";
4af0c9f
 
4af0c9f
-- 
4af0c9f
2.25.4
4af0c9f
4af0c9f
4af0c9f
From d5948fd41013dfe4d2d10083111821667977c6d1 Mon Sep 17 00:00:00 2001
4af0c9f
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
4af0c9f
Date: Tue, 27 Oct 2020 21:04:14 +0000
4af0c9f
Subject: [PATCH 2/2] mountlist: recognize more file system types as remote
4af0c9f
4af0c9f
Sync "remote" file systems from stat.c in coreutils.
4af0c9f
Note we only consider file systems that do not use host:resource
4af0c9f
mount source.  I.e. those that don't generally use a colon when
4af0c9f
mounting, as that case is already considered.  Searching for
4af0c9f
"<fstype> /etc/fstab" was informative for identifying these.
4af0c9f
The full list of "remote" file systems in coreutils is currently:
4af0c9f
  acfs afs ceph cifs coda fhgfs fuseblk fusectl
4af0c9f
  gfs gfs2 gpfs ibrix k-afs lustre novell nfs nfsd
4af0c9f
  ocfs2 panfs prl_fs smb smb2 snfs vboxsf vmhgfs vxfs
4af0c9f
Note also we do not include virtual machine file systems,
4af0c9f
as even though they're remote to the current kernel,
4af0c9f
they are generally not distributed to separate hosts.
4af0c9f
4af0c9f
* lib/mountlist.c (ME_REMOTE): Sync previously unconsidered
4af0c9f
"remote" file systems from stat.c in coreutils.
4af0c9f
4af0c9f
Upstream-commit: dd1fc46be12d671c1a9d9dc5a6fa8c766e99aa2f
4af0c9f
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
4af0c9f
---
4af0c9f
 lib/mountlist.c | 12 ++++++++++--
4af0c9f
 1 file changed, 10 insertions(+), 2 deletions(-)
4af0c9f
4af0c9f
diff --git a/lib/mountlist.c b/lib/mountlist.c
4af0c9f
index 7abe024..e0227b7 100644
4af0c9f
--- a/lib/mountlist.c
4af0c9f
+++ b/lib/mountlist.c
4af0c9f
@@ -221,8 +221,9 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
4af0c9f
 #ifndef ME_REMOTE
4af0c9f
 /* A file system is "remote" if its Fs_name contains a ':'
4af0c9f
    or if (it is of type (smbfs or cifs) and its Fs_name starts with '//')
4af0c9f
-   or if it is of type (afs or auristorfs)
4af0c9f
-   or Fs_name is equal to "-hosts" (used by autofs to mount remote fs).  */
4af0c9f
+   or if it is of any other of the listed types
4af0c9f
+   or Fs_name is equal to "-hosts" (used by autofs to mount remote fs).
4af0c9f
+   "VM" file systems like prl_fs or vboxsf are not considered remote here. */
4af0c9f
 # define ME_REMOTE(Fs_name, Fs_type)            \
4af0c9f
     (strchr (Fs_name, ':') != NULL              \
4af0c9f
      || ((Fs_name)[0] == '/'                    \
4af0c9f
@@ -230,8 +231,15 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
4af0c9f
          && (strcmp (Fs_type, "smbfs") == 0     \
4af0c9f
              || strcmp (Fs_type, "smb3") == 0   \
4af0c9f
              || strcmp (Fs_type, "cifs") == 0)) \
4af0c9f
+     || strcmp (Fs_type, "acfs") == 0           \
4af0c9f
      || strcmp (Fs_type, "afs") == 0            \
4af0c9f
+     || strcmp (Fs_type, "coda") == 0           \
4af0c9f
      || strcmp (Fs_type, "auristorfs") == 0     \
4af0c9f
+     || strcmp (Fs_type, "fhgfs") == 0          \
4af0c9f
+     || strcmp (Fs_type, "gpfs") == 0           \
4af0c9f
+     || strcmp (Fs_type, "ibrix") == 0          \
4af0c9f
+     || strcmp (Fs_type, "ocfs2") == 0          \
4af0c9f
+     || strcmp (Fs_type, "vxfs") == 0           \
4af0c9f
      || strcmp ("-hosts", Fs_name) == 0)
4af0c9f
 #endif
4af0c9f
 
4af0c9f
-- 
4af0c9f
2.25.4
4af0c9f