On 2020-06-18 17:57, Pausch Manfred wrote:
> Hello
> 
> When I tail a logfile that’s located on a VirtualBox guest shared folder than 
> I get this message:
> 
> tail: unrecognized file system type 0x786f4256 for 
> ‘oracle_12102_PSU190716-20200618_174315.log’. please report this to 
> bug-coreutils@gnu.org. reverting to polling
> 
> My setup:
> VirtualBox Guest: Oracle Linux 7.x
> VirtualBox Host: Windows 10
> 
> A directory on the host is mapped into the guest via VirtualBox shared folder 
> and mounted in the guest.
> The process that writes to the logfile runs inside the guest. And tail that 
> follows the logfile also runs inside the guest.

Thanks for the report.
It's unusual that this FS-type slipped through for so long.
The attached fixes it.

An internet search unveils that inotify does not seem to work reliably
for 'vboxsf', and I think that this cannot really reliably work, e.g. if a 
Windows
host exposes a directory on a CIFS share into a Linux guest VM (which works, I 
tried).
Therefore, I've marked 'vboxsf' as a 'remote' file system which uses polling.

Have a nice day,
Berny
>From f5644c986ce39c6ca5fffbae30a2828b8ee56502 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Fri, 19 Jun 2020 20:33:55 +0200
Subject: [PATCH] stat,tail: add support for the VBOXSF file system

* src/stat.c (human_fstype): Add case for the 'vboxsf' file system type
which is used for VirtualBox Shared Folders mounted in VirtualBox guest
VMs.
* NEWS: Mention the Improvement.
Fixes https://bugs.gnu.org/41935
---
 NEWS       | 5 +++++
 src/stat.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index 655ff779f..d36259641 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,11 @@ GNU coreutils NEWS                                    -*- outline -*-
    ls --classify now supports the "always", "auto", or "never" flags,
    to support only outputting classifier characters if connected to a tty.
 
+** Improvements
+
+  stat and tail now know about the "vboxsf" file system type.
+  stat -f -c%T now reports the file system type, and tail -f uses polling.
+
 
 * Noteworthy changes in release 8.32 (2020-03-05) [stable]
 
diff --git a/src/stat.c b/src/stat.c
index 5012622c3..4e6c2aa86 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -527,6 +527,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "usbdevfs";
     case S_MAGIC_V9FS: /* 0x01021997 local */
       return "v9fs";
+    case S_MAGIC_VBOXSF: /* 0x786F4256 remote */
+      return "vboxsf";
     case S_MAGIC_VMHGFS: /* 0xBACBACBC remote */
       return "vmhgfs";
     case S_MAGIC_VXFS: /* 0xA501FCF5 remote */
-- 
2.27.0

Reply via email to