bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs


From: Pádraig Brady
Subject: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs
Date: Thu, 13 Jul 2023 13:35:28 +0100
User-agent: Mozilla Thunderbird

On 13/07/2023 11:33, support wrote:
Hmmm ok,

Well the reason I flagged it as a bug, is because the btrfsmaintenance
package uses a script to test to see if a filesystem is btrfs and
incorrectly uses stat -f to do it. This must have worked in the past
else they would not use it.

The code snippet is:


# function: is_btrfs
# parameter: path to a mounted filesystem
#
# check if filesystem is a btrfs
is_btrfs() {
      local FS=$(stat -f --format=%T "$1")
      [ "$FS" = "btrfs" ] && return 0
      return 1
}


Obviously that is targeted at mounted filesystems, but the documentation
and usage always shows "<path>|<device>" as a parameter.

I guess I should file a bug against that package but I am curious as to
when the default behaviour changed.

It has never changed AFAIK

thanks,
Pádraig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]