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

Previous Next

Package: coreutils;

Reported by: "debug <at> roosoft.ltd.uk" <debug <at> roosoft.ltd.uk>

Date: Thu, 13 Jul 2023 03:28:01 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: "debug <at> roosoft.ltd.uk" <debug <at> roosoft.ltd.uk>, 64588 <at> debbugs.gnu.org
Subject: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs
Date: Thu, 13 Jul 2023 13:35:28 +0100
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




This bug report was last modified 1 year and 312 days ago.

Previous Next


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