[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#295168: /usr/bin/stat: does not know about XFS fs type
From: |
Jim Meyering |
Subject: |
Re: Bug#295168: /usr/bin/stat: does not know about XFS fs type |
Date: |
Tue, 15 Feb 2005 10:26:02 +0100 |
Bernd Eckenfels <address@hidden> wrote:
> Package: coreutils
> Version: 5.2.1-2
>
> stat is reporting, that it does not know the XFS filesystem:
>
>> stat -f /usr
> File: "/usr"
> ID: fe01 Namelen: 255 Type: UNKNOWN (0x58465342)
Thanks for reporting that.
I've just confirmed that linux-2.6.11-rc3 xfs uses the same number.
With the fix below, I get this:
$ ./stat --format=%T -f /tmp/mnt; echo
xfs
Here's the patch:
* src/stat.c (human_fstype): Add case/definition for S_MAGIC_XFS
so that file systems of type `xfs' are recognized as such.
* src/fs.h: Regenerate.
Reported by Bernd Eckenfels.
Index: src/stat.c
===================================================================
RCS file: /fetish/cu/src/stat.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -p -u -r1.78 -r1.79
--- src/stat.c 8 Feb 2005 21:38:53 -0000 1.78
+++ src/stat.c 15 Feb 2005 08:57:59 -0000 1.79
@@ -142,6 +142,8 @@ human_fstype (STRUCT_STATVFS const *stat
return "ext2";
case S_MAGIC_EXT2: /* 0xEF53 */
return "ext2/ext3";
+ case S_MAGIC_XFS: /* 0x58465342 */
+ return "xfs";
case S_MAGIC_HPFS: /* 0xF995E849 */
return "hpfs";
case S_MAGIC_ISOFS: /* 0x9660 */
Index: src/fs.h
===================================================================
RCS file: /fetish/cu/src/fs.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -u -r1.8 -r1.9
--- src/fs.h 5 Sep 2004 07:11:47 -0000 1.8
+++ src/fs.h 15 Feb 2005 09:01:34 -0000 1.9
@@ -8,6 +8,7 @@
# define S_MAGIC_EXT 0x137D
# define S_MAGIC_EXT2_OLD 0xEF51
# define S_MAGIC_EXT2 0xEF53
+# define S_MAGIC_XFS 0x58465342
# define S_MAGIC_HPFS 0xF995E849
# define S_MAGIC_ISOFS 0x9660
# define S_MAGIC_ISOFS_WIN 0x4000
- Re: Bug#295168: /usr/bin/stat: does not know about XFS fs type,
Jim Meyering <=