bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* df --local treats AFS mounts as local
@ 2020-02-04 19:21 Marc Dionne
  2020-02-05 21:47 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Dionne @ 2020-02-04 19:21 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

df bases it's local/remote distinction on the "me_remote" flag from
gnulib's lib/mountpoint.

The ME_REMOTE macro has a few special cases that cover some common
network filesystems such as nfs and smb/cifs, but mounts of /afs are
treated as local even though it is a distributed filesystem.

Attached is a proposed patch that adds special cases for the known
filesystem types for the AFS protocol, 'afs' (OpenAFS, Linux kernel
kafs module) and 'auristorfs' (AuriStorFS).

Ideally the remoteness would be determined by querying the filesystem
and without having to hard code special cases.  This would be possible
for instance eventually on Linux if/when the new fsinfo system call
gets merged into the kernel, as filesystems will be able to advertise
a "fs is network filesystem" feature bit.

Thanks,
Marc

[-- Attachment #2: 0001-mountlist-Consider-AFS-filesystems-as-remote.patch --]
[-- Type: text/x-patch, Size: 1695 bytes --]

From 5f47c372cd94867ce8a303e5ddba38b7e4bc6d8b Mon Sep 17 00:00:00 2001
From: Marc Dionne <marc.dionne@auristor.com>
Date: Tue, 4 Feb 2020 11:40:05 -0400
Subject: [PATCH] mountlist: Consider AFS filesystems as remote

df --local relies on the ME_REMOTE macro to determine if a given
mount entry should be considered "local".  There is special logic
for nfs and smb/cifs mounts, but /afs as mounted by OpenAFS, the
kernel's kafs module or AuriStorFS is treated as a local mount.

Add some logic to treat mounts of type 'afs' (OpenAFS, kernel kafs)
and 'auristorfs' (AuriStorFS) as remote.

Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
---
 lib/mountlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/mountlist.c b/lib/mountlist.c
index 61063ce91..255e350e0 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -221,6 +221,7 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
 #ifndef ME_REMOTE
 /* A file system is "remote" if its Fs_name contains a ':'
    or if (it is of type (smbfs or cifs) and its Fs_name starts with '//')
+   or if it is of type (afs or auristorfs)
    or Fs_name is equal to "-hosts" (used by autofs to mount remote fs).  */
 # define ME_REMOTE(Fs_name, Fs_type)            \
     (strchr (Fs_name, ':') != NULL              \
@@ -228,6 +229,8 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
          && (Fs_name)[1] == '/'                 \
          && (strcmp (Fs_type, "smbfs") == 0     \
              || strcmp (Fs_type, "cifs") == 0)) \
+     || strcmp (Fs_type, "afs") == 0            \
+     || strcmp (Fs_type, "auristorfs") == 0     \
      || (strcmp("-hosts", Fs_name) == 0))
 #endif
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: df --local treats AFS mounts as local
  2020-02-04 19:21 df --local treats AFS mounts as local Marc Dionne
@ 2020-02-05 21:47 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2020-02-05 21:47 UTC (permalink / raw)
  To: Marc Dionne; +Cc: bug-gnulib

Thanks, I installed that into Gnulib master.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-05 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 19:21 df --local treats AFS mounts as local Marc Dionne
2020-02-05 21:47 ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).