Whamcloud - gitweb
debugfs: print "Xst" bits of file mode via stat
authorAndreas Dilger <adilger@dilger.ca>
Mon, 16 Oct 2017 02:27:40 +0000 (22:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 16 Oct 2017 02:27:40 +0000 (22:27 -0400)
commit8dca24c3cb23d69a484b28a0bc2f64a89508c1eb
tree2b8c9b5d401f428cc7679146db0955389edaf9d3
parent21f685b6c1914bef2cf1e54ec5f73c7dce10a9f1
debugfs: print "Xst" bits of file mode via stat

Currently, debugfs does not print the Xst high-order mode bits
in the "stat" output.  While "ls -l" shows these bits are set:

  # ls -il /mnt/tmp/O/0/d2/406306
  1588 0 -rwSrwSrw- 1 root root 0 Dec 31  1969 /mnt/tmp/O/0/d2/406306

debugfs currently only prints the low nine "ugo" mode bits:

  # debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
  Inode: 1588   Type: regular    Mode:  0666   Flags: 0x80000

Fix debugfs so that the high-order mode bits are also printed,
if available, otherwise only print the standard low mode bits.

  # debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
  Inode: 1588   Type: regular    Mode:  06666   Flags: 0x80000

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c