GNU bug report logs - #12301
tail -F & ZFS

Previous Next

Package: coreutils;

Reported by: Raimonds Miltins <raimonds <at> pro-9.com>

Date: Wed, 29 Aug 2012 06:57:02 UTC

Severity: normal

Merged with 12498, 16080, 18492

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12301 in the body.
You can then email your comments to 12301 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 06:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raimonds Miltins <raimonds <at> pro-9.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 29 Aug 2012 06:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Raimonds Miltins <raimonds <at> pro-9.com>
To: <bug-coreutils <at> gnu.org>
Subject: tail -F & ZFS
Date: Wed, 29 Aug 2012 08:00:29 +0300
Hello,

I'm using Gentoo linux on ZFS and see following when opened file with 
tail -F (or -f):
tail: unrecognized file system type 0x2fc12fc1 for ‘/var/log/messages’. 
please report this to bug-coreutils <at> gnu.org. reverting to polling

Distro: Gentoo
Kernel: 3.2.22
Coreutils: 8.16


-- 
Raimonds Miltiņš
SIA "PRO-9"
phone: +371 26101996
gsm:   +371 29427647




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Wed, 29 Aug 2012 07:45:02 GMT) Full text and rfc822 format available.

Notification sent to Raimonds Miltins <raimonds <at> pro-9.com>:
bug acknowledged by developer. (Wed, 29 Aug 2012 07:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 12301-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Raimonds Miltins <raimonds <at> pro-9.com>
Cc: 12301-done <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 09:43:04 +0200
Raimonds Miltins wrote:
> I'm using Gentoo linux on ZFS and see following when opened file with
> tail -F (or -f):
> tail: unrecognized file system type 0x2fc12fc1 for
> ‘/var/log/messages’. please report this to
> bug-coreutils <at> gnu.org. reverting to polling
>
> Distro: Gentoo
> Kernel: 3.2.22
> Coreutils: 8.16

Thank you!  That also affects the very latest, coreutils-8.19.
Here's the patch I've just pushed:

From c9888e0debce29c6a0f7134bbc6d0ffd3f196bc5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> redhat.com>
Date: Wed, 29 Aug 2012 09:32:49 +0200
Subject: [PATCH] tail,stat: improve support for ZFS

This change enables tail -f to use inotify and lets
stat -f --format=%T report the file system type name, "zfs".
* src/stat.c (human_fstype): Add a case: zfs, 0x2fc12fc1.
* NEWS (Improvements): Mention it.
* THANKS.in: Update.
Reported by Raimonds Miltins in http://bugs.gnu.org/12301.
---
 NEWS       | 7 +++++++
 THANKS.in  | 1 +
 src/stat.c | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/NEWS b/NEWS
index 798a512..f3874fd 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,13 @@ GNU coreutils NEWS                                    -*- outline -*-
   than ignoring the -d option and failing with an 'Is a directory' error.
   [bug introduced in coreutils-8.19, with the addition of --dir (-d)]

+** Improvements
+
+  stat and tail work better with ZFS.  stat -f --format=%T now reports the
+  file system type, "zfs", and tail -f now uses inotify for files on ZFS
+  file systems, rather than the default (for unknown file system types)
+  of polling.
+

 * Noteworthy changes in release 8.19 (2012-08-20) [stable]

diff --git a/THANKS.in b/THANKS.in
index f288174..1580151 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -507,6 +507,7 @@ Piotr Kwapulinski                   kwap <at> univ.gda.pl
 Prashant TR                         tr <at> eth.net
 Priit Jõerüüt                       jemm4jemm <at> yahoo.com
 Primoz PETERLIN                     primozz.peterlin <at> gmail.com
+Raimonds Miltins                    raimonds <at> pro-9.com
 Rainer Orth                         ro <at> TechFak.Uni-Bielefeld.DE
 Ralf W. Stephan                     stephan <at> tmt.de
 Ralph Loader                        loader <at> maths.ox.ac.uk
diff --git a/src/stat.c b/src/stat.c
index e56f1ff..f75b7af 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -423,6 +423,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "xfs";
     case S_MAGIC_XIAFS: /* 0x012FD16D local */
       return "xia";
+    case S_MAGIC_ZFS: /* 0x2FC12FC1 local */
+      return "zfs";

 # elif __GNU__
     case FSTYPE_UFS:
--
1.7.12.116.g31e0100




Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 08:48:02 GMT) Full text and rfc822 format available.

Message #13 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: 12301 <at> debbugs.gnu.org, jim <at> meyering.net
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 10:46:09 +0200
On 08/29/2012 09:43 AM, Jim Meyering wrote:
> This change enables tail -f to use inotify and lets
> stat -f --format=%T report the file system type name, "zfs".
> * src/stat.c (human_fstype): Add a case: zfs, 0x2fc12fc1.

Hi Jim,

I tried to find documentation about that magic number.

There seem to exist several implementations of ZFS [1],
and I could find it only for the ZFSONLINUX project [2],
but not in the official OpenSolaris ZFS specification [3].

Can we be sure that 0x2fc12fc1 is used for all ZFS
implementations?

[1] http://en.wikipedia.org/wiki/ZFS
[2] https://github.com/zfsonlinux/zfs/blob/master/include/sys/zfs_vfsops.h
[3] http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf

Have a nice day,
Berny





Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 09:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: 12301 <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 11:12:14 +0200
Bernhard Voelker wrote:
> On 08/29/2012 09:43 AM, Jim Meyering wrote:
>> This change enables tail -f to use inotify and lets
>> stat -f --format=%T report the file system type name, "zfs".
>> * src/stat.c (human_fstype): Add a case: zfs, 0x2fc12fc1.
>
> Hi Jim,
>
> I tried to find documentation about that magic number.
>
> There seem to exist several implementations of ZFS [1],
> and I could find it only for the ZFSONLINUX project [2],
> but not in the official OpenSolaris ZFS specification [3].

Hi Bernie,

Thanks for looking into that.

> Can we be sure that 0x2fc12fc1 is used for all ZFS
> implementations?

If there end up being two or more magic numbers for the same file
system (or ZFS variants going by new names), we'll adapt.

> [1] http://en.wikipedia.org/wiki/ZFS
> [2] https://github.com/zfsonlinux/zfs/blob/master/include/sys/zfs_vfsops.h
> [3]
> http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf




Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 09:35:01 GMT) Full text and rfc822 format available.

Message #19 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Jim Meyering <jim <at> meyering.net>
Cc: 12301 <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 11:33:13 +0200
On 08/29/2012 11:12 AM, Jim Meyering wrote:
>> Can we be sure that 0x2fc12fc1 is used for all ZFS
>> implementations?
>
> If there end up being two or more magic numbers for the same file
> system (or ZFS variants going by new names), we'll adapt.

Ok, that sounds good. Thanks.

Have a nice day,
Berny




Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 14:32:01 GMT) Full text and rfc822 format available.

Message #22 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Jim Meyering <jim <at> meyering.net>, 12301 <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 16:29:46 +0200
Hi,

On Wed, Aug 29, 2012 at 11:33:13AM +0200, Bernhard Voelker wrote:
> On 08/29/2012 11:12 AM, Jim Meyering wrote:
> >> Can we be sure that 0x2fc12fc1 is used for all ZFS
> >> implementations?
> >
> > If there end up being two or more magic numbers for the same file
> > system (or ZFS variants going by new names), we'll adapt.
> 
> Ok, that sounds good. Thanks.

How can I check this magic number on a Solaris 10 system with ZFS?
Neither GNU coreutils nor a C compiler installed. :-(

$ uname -a
SunOS demchpux 5.10 Generic_138888-08 sun4v sparc SUNW,SPARC-Enterprise-T5120
$ df -n /
/                  : zfs
$ df -g /
/                  (/                 ):       131072 block size           512 frag size
       0 total blocks   82144537 free blocks 82144537 available       82388038 total files
82144537 free files     67174412 filesys id
     zfs fstype       0x00000004 flag             255 filename length

Regards,
Erik




Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 15:15:01 GMT) Full text and rfc822 format available.

Message #25 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
Cc: Bernhard Voelker <mail <at> bernhard-voelker.de>, 12301 <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 17:13:19 +0200
reopen 12301
thanks

Erik Auerswald wrote:
> On Wed, Aug 29, 2012 at 11:33:13AM +0200, Bernhard Voelker wrote:
>> On 08/29/2012 11:12 AM, Jim Meyering wrote:
>> >> Can we be sure that 0x2fc12fc1 is used for all ZFS
>> >> implementations?
>> >
>> > If there end up being two or more magic numbers for the same file
>> > system (or ZFS variants going by new names), we'll adapt.
>>
>> Ok, that sounds good. Thanks.
>
> How can I check this magic number on a Solaris 10 system with ZFS?
> Neither GNU coreutils nor a C compiler installed. :-(
>
> $ uname -a
> SunOS demchpux 5.10 Generic_138888-08 sun4v sparc SUNW,SPARC-Enterprise-T5120
> $ df -n /
> /                  : zfs
> $ df -g /
> /                  (/                 ):       131072 block size           512 frag size
>        0 total blocks   82144537 free blocks 82144537 available       82388038 total files
> 82144537 free files     67174412 filesys id
>      zfs fstype       0x00000004 flag             255 filename length

Thanks for your interest.
If you have perl of python, you can have them call statvfs,
then simply run truss on the script and you'll see what
statvfs produces, one field of which should be an "fsid" member:

However, your query prompted me to build the latest on
a Solaris 10 system and see:

    sol10$ ./stat --fo=%T -f /
    zfs
    sol10$ truss -v statvfs ./stat --fo=%T -f /
    ...
    statvfs64("/", 0xFFBFFAA8)                      = 0
            bsize=131072     frsize=512       blocks=117101360 bfree=92845257
            bavail=92845257  files=93143101   ffree=92845257  favail=92845257
            fsid=0x4010002   basetype=zfs     namemax=255
            flag=ST_NOTRUNC
            fstr=""
    ...

Hmm... fsid=0x4010002.
That is definitely not the same number as what is now recorded in
stat.c, so this deserves more investigation:

    case S_MAGIC_ZFS: /* 0x2FC12FC1 local */
      return "zfs";

This also shows there is room for improvement.
(should print the hexadecimal FSID):

    sol10$ ./stat --fo=%t -f /
    ?

This latter might deserve its own bug, but for now,
I've simply reopened the original ZFS-related bug.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 29 Aug 2012 15:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#12301; Package coreutils. (Wed, 29 Aug 2012 16:14:01 GMT) Full text and rfc822 format available.

Message #30 received at 12301 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>,
	Bernhard Voelker <mail <at> bernhard-voelker.de>, 12301 <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 17:11:54 +0100
On 08/29/2012 04:13 PM, Jim Meyering wrote:
> reopen 12301
> thanks
> 
> Erik Auerswald wrote:
>> On Wed, Aug 29, 2012 at 11:33:13AM +0200, Bernhard Voelker wrote:
>>> On 08/29/2012 11:12 AM, Jim Meyering wrote:
>>>>> Can we be sure that 0x2fc12fc1 is used for all ZFS
>>>>> implementations?
>>>>
>>>> If there end up being two or more magic numbers for the same file
>>>> system (or ZFS variants going by new names), we'll adapt.
>>>
>>> Ok, that sounds good. Thanks.
>>
>> How can I check this magic number on a Solaris 10 system with ZFS?
>> Neither GNU coreutils nor a C compiler installed. :-(
>>
>> $ uname -a
>> SunOS demchpux 5.10 Generic_138888-08 sun4v sparc SUNW,SPARC-Enterprise-T5120
>> $ df -n /
>> /                  : zfs
>> $ df -g /
>> /                  (/                 ):       131072 block size           512 frag size
>>        0 total blocks   82144537 free blocks 82144537 available       82388038 total files
>> 82144537 free files     67174412 filesys id
>>      zfs fstype       0x00000004 flag             255 filename length
> 
> Thanks for your interest.
> If you have perl of python, you can have them call statvfs,
> then simply run truss on the script and you'll see what
> statvfs produces, one field of which should be an "fsid" member:
> 
> However, your query prompted me to build the latest on
> a Solaris 10 system and see:
> 
>     sol10$ ./stat --fo=%T -f /
>     zfs
>     sol10$ truss -v statvfs ./stat --fo=%T -f /
>     ...
>     statvfs64("/", 0xFFBFFAA8)                      = 0
>             bsize=131072     frsize=512       blocks=117101360 bfree=92845257
>             bavail=92845257  files=93143101   ffree=92845257  favail=92845257
>             fsid=0x4010002   basetype=zfs     namemax=255
>             flag=ST_NOTRUNC
>             fstr=""
>     ...
> 
> Hmm... fsid=0x4010002.
> That is definitely not the same number as what is now recorded in
> stat.c, so this deserves more investigation:
> 
>     case S_MAGIC_ZFS: /* 0x2FC12FC1 local */
>       return "zfs";
> 
> This also shows there is room for improvement.
> (should print the hexadecimal FSID):
> 
>     sol10$ ./stat --fo=%t -f /
>     ?
> 
> This latter might deserve its own bug, but for now,
> I've simply reopened the original ZFS-related bug.

I don't think there is an issue here.

fsid is a per file system rather than per file system type.
So '?' is correct on Solaris as it doesn't expose the file
system type ID (it doesn't have statfs).

Also tail will default to the more portable polling
method when f_type is not available.

cheers,
Pádraig.




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Wed, 29 Aug 2012 16:32:01 GMT) Full text and rfc822 format available.

Notification sent to Raimonds Miltins <raimonds <at> pro-9.com>:
bug acknowledged by developer. (Wed, 29 Aug 2012 16:32:02 GMT) Full text and rfc822 format available.

Message #35 received at 12301-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>,
	Bernhard Voelker <mail <at> bernhard-voelker.de>, 12301-done <at> debbugs.gnu.org
Subject: Re: bug#12301: tail -F & ZFS
Date: Wed, 29 Aug 2012 18:30:39 +0200
Pádraig Brady wrote:
...
>> Hmm... fsid=0x4010002.
>> That is definitely not the same number as what is now recorded in
>> stat.c, so this deserves more investigation:
>>
>>     case S_MAGIC_ZFS: /* 0x2FC12FC1 local */
>>       return "zfs";
>>
>> This also shows there is room for improvement.
>> (should print the hexadecimal FSID):
>>
>>     sol10$ ./stat --fo=%t -f /
>>     ?
>>
>> This latter might deserve its own bug, but for now,
>> I've simply reopened the original ZFS-related bug.
>
> I don't think there is an issue here.
>
> fsid is a per file system rather than per file system type.
> So '?' is correct on Solaris as it doesn't expose the file
> system type ID (it doesn't have statfs).
>
> Also tail will default to the more portable polling
> method when f_type is not available.

Oh, good.  Then this really is "done".  Marking as such.
Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 27 Sep 2012 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Sun, 30 Sep 2012 05:57:01 GMT) Full text and rfc822 format available.

Forcibly Merged 12301 12498. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Sun, 30 Sep 2012 05:57:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Oct 2012 11:24:02 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 06 Dec 2013 20:16:02 GMT) Full text and rfc822 format available.

Forcibly Merged 12301 12498 16080. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 06 Dec 2013 20:16:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 16080 <at> debbugs.gnu.org and G McAlister <graham.mcalis <at> btconnect.com> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 06 Dec 2013 20:37:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 Jan 2014 12:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Bernhard Voelker <mail <at> bernhard-voelker.de> to control <at> debbugs.gnu.org. (Thu, 18 Sep 2014 09:30:03 GMT) Full text and rfc822 format available.

Forcibly Merged 12301 12498 16080 18492. Request was from Bernhard Voelker <mail <at> bernhard-voelker.de> to control <at> debbugs.gnu.org. (Thu, 18 Sep 2014 09:30:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 16 Oct 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.