Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* btrfs fi df <mount point> outputs info instead of error even when <mount-point> is just a directory
@ 2014-07-02  5:14 Vikram Goyal
  2014-07-02  6:19 ` Qu Wenruo
  0 siblings, 1 reply; 3+ messages in thread
From: Vikram Goyal @ 2014-07-02  5:14 UTC (permalink / raw)
  To: linux-btrfs

Hi,

As the subject specifies there is some confusion (at least with me:) as
to what should be the ouput/behaviour of command btrfs fi df

Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1114995

The comment by Eric Sendeen further complicates the understanding.
(again with me:)

1} The command btrfs fi df has been more or less been equated with
   traditional df. The problem is that traditional df does not output
   error when no path is given as what currently is done by btrfs fi df
2} Traditional df outputs a column 'Mounted on' for each device/fs it
   finds which btrfs fi df does not. For Ex.

   [vikram@localhost ~]# df
   Filesystem     1K-blocks      Used Available Use% Mounted on
   /dev/sdb6      153942744  69903440  81431312  47% /
   devtmpfs         1520392         0   1520392   0% /dev
   tmpfs            1527612      1444   1526168   1% /dev/shm
   tmpfs            1527612      9108   1518504   1% /run
   tmpfs            1527612         0   1527612   0% /sys/fs/cgroup
   tmpfs            1527612       120   1527492   1% /tmp
   /dev/sda1        1515376    172040   1248312  13% /boot
   /dev/dm-0      330327632 230022072  97561080  71% /home/vikram

   [vikram@localhost ~]# btrfs fi df /usr/
   Data, RAID1: total=42.00GiB, used=32.44GiB
   System, RAID1: total=32.00MiB, used=12.00KiB
   Metadata, RAID1: total=2.00GiB, used=915.04MiB

   [vikram@localhost ~]# btrfs fi df /
   Data, RAID1: total=42.00GiB, used=32.44GiB
   System, RAID1: total=32.00MiB, used=12.00KiB
   Metadata, RAID1: total=2.00GiB, used=915.04MiB

  [ivikram@localhost ~]# btrfs fi show
  Label: 'fedora'  uuid: d2b3420c-99c1-44cc-a922-ac266072c7fb
          Total devices 2 FS bytes used 33.33GiB
          devid    2 size 73.51GiB used 44.03GiB path /dev/sdb6
          devid    3 size 73.30GiB used 44.03GiB path /dev/sda2

  Label: 'Vikram'  uuid: 0809b072-35f3-4866-92b8-af4772b23ed6
          Total devices 2 FS bytes used 109.68GiB
          devid    1 size 158.03GiB used 157.00GiB path /dev/dm-0
          devid    2 size 157.00GiB used 157.00GiB path /dev/mapper/sdb1

So there in no way to understand if there was an error (except for non existant
path) in the path argument given to btrfs fi df. This can create a lot of
confusion in administeration.

So IMHO some changes need to done to btrfs fi df.

1} The requirement for path arg be removed, since that gives a false impression
   by a valid output that the arg was correct as in fs mount point sense POV.

2} btrfs fi df should output the mount point in all cases:
   a} Where arg path is valid but not a mount point. Should output btrfs FS info with mount point as traditional df.
   b} Where arg path is valid & is also a mount point. Should show output for that mount only.
   c} Where no arg is given, Should output all btrfs FSes info with mount points.

3} btrfs fi df should error out on an invalid path as it does currently.

Thanks for your precious time.

-- 
vikram...
         ||||||||
         ||||||||
^^'''''^^||root||^^^'''''''^^
        // \\   ))
       //(( \\// \\
      // /\\ ||   \\
     || / )) ((    \\
-- 
Nice boy, but about as sharp as a sack of wet mice.
		-- Foghorn Leghorn
-- 
  o
 ~|~
  =

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs fi df <mount point> outputs info instead of error even when <mount-point> is just a directory
  2014-07-02  5:14 btrfs fi df <mount point> outputs info instead of error even when <mount-point> is just a directory Vikram Goyal
@ 2014-07-02  6:19 ` Qu Wenruo
  2014-07-02 12:57   ` Vikram Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2014-07-02  6:19 UTC (permalink / raw)
  To: linux-btrfs


-------- Original Message --------
Subject: btrfs fi df <mount point> outputs info instead of error even 
when <mount-point> is just a directory
From: Vikram Goyal <vikigoyal@gmail.com>
To: linux-btrfs@vger.kernel.org
Date: 2014年07月02日 13:14
> Hi,
>
> As the subject specifies there is some confusion (at least with me:) as
> to what should be the ouput/behaviour of command btrfs fi df
>
> Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1114995
>
> The comment by Eric Sendeen further complicates the understanding.
> (again with me:)
>
> 1} The command btrfs fi df has been more or less been equated with
>   traditional df. The problem is that traditional df does not output
>   error when no path is given as what currently is done by btrfs fi df
It is OK to show all btrfs usage info when no path is given.
If no one rejects, I'll try to make patch to change the behavior of 
'btrfs fi di'
> 2} Traditional df outputs a column 'Mounted on' for each device/fs it
>   finds which btrfs fi df does not. For Ex.
>
>   [vikram@localhost ~]# df
>   Filesystem     1K-blocks      Used Available Use% Mounted on
>   /dev/sdb6      153942744  69903440  81431312  47% /
>   devtmpfs         1520392         0   1520392   0% /dev
>   tmpfs            1527612      1444   1526168   1% /dev/shm
>   tmpfs            1527612      9108   1518504   1% /run
>   tmpfs            1527612         0   1527612   0% /sys/fs/cgroup
>   tmpfs            1527612       120   1527492   1% /tmp
>   /dev/sda1        1515376    172040   1248312  13% /boot
>   /dev/dm-0      330327632 230022072  97561080  71% /home/vikram
>
>   [vikram@localhost ~]# btrfs fi df /usr/
>   Data, RAID1: total=42.00GiB, used=32.44GiB
>   System, RAID1: total=32.00MiB, used=12.00KiB
>   Metadata, RAID1: total=2.00GiB, used=915.04MiB
>
>   [vikram@localhost ~]# btrfs fi df /
>   Data, RAID1: total=42.00GiB, used=32.44GiB
>   System, RAID1: total=32.00MiB, used=12.00KiB
>   Metadata, RAID1: total=2.00GiB, used=915.04MiB
'btrfs fi df' uses btrfs-only ioctl to get usage info, so it's OK when a 
non-mountpoint
file is given.
Although this should be fixed by checking whether the parameter is a 
mountpoint.
I'll also try to fix this too.
>
>  [ivikram@localhost ~]# btrfs fi show
>  Label: 'fedora'  uuid: d2b3420c-99c1-44cc-a922-ac266072c7fb
>          Total devices 2 FS bytes used 33.33GiB
>          devid    2 size 73.51GiB used 44.03GiB path /dev/sdb6
>          devid    3 size 73.30GiB used 44.03GiB path /dev/sda2
>
>  Label: 'Vikram'  uuid: 0809b072-35f3-4866-92b8-af4772b23ed6
>          Total devices 2 FS bytes used 109.68GiB
>          devid    1 size 158.03GiB used 157.00GiB path /dev/dm-0
>          devid    2 size 157.00GiB used 157.00GiB path /dev/mapper/sdb1
>
I'm very sorry that I did catch the point why 'btrfs fi show' is used 
here and what's the problem.
It would be very nice if you can explain what's wrong with 'btrfs fi show'.

> So there in no way to understand if there was an error (except for non 
> existant
> path) in the path argument given to btrfs fi df. This can create a lot of
> confusion in administeration.
>
> So IMHO some changes need to done to btrfs fi df.
>
> 1} The requirement for path arg be removed, since that gives a false 
> impression
>   by a valid output that the arg was correct as in fs mount point 
> sense POV.
As mentioned above, there are 2 points related to it.
1.1) default behavior change when no arg is given
It is OK to show all btrfs disk usage when no arg is given just like 
'df' command.

1.2) add mount point check
This can be done quite easily.

>
> 2} btrfs fi df should output the mount point in all cases:
>   a} Where arg path is valid but not a mount point. Should output 
> btrfs FS info with mount point as traditional df.
Nice idea. I'll add a warning about this.
>   b} Where arg path is valid & is also a mount point. Should show 
> output for that mount only.
Current behavior already.
>   c} Where no arg is given, Should output all btrfs FSes info with 
> mount points.
Point 1.1) will cover this.
>
> 3} btrfs fi df should error out on an invalid path as it does currently.
Point 1.2) will cover this.
>
> Thanks for your precious time.
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs fi df <mount point> outputs info instead of error even when <mount-point> is just a directory
  2014-07-02  6:19 ` Qu Wenruo
@ 2014-07-02 12:57   ` Vikram Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Vikram Goyal @ 2014-07-02 12:57 UTC (permalink / raw)
  To: linux-btrfs

On Wed, Jul 02, 2014 at 02:19:52PM +0800, Qu Wenruo wrote:
>
>-------- Original Message --------
>Subject: btrfs fi df <mount point> outputs info instead of error even 
>when <mount-point> is just a directory
>From: Vikram Goyal <vikigoyal@gmail.com>
>To: linux-btrfs@vger.kernel.org
>Date: 2014年07月02日 13:14
>>Hi,

<snip>

>Although this should be fixed by checking whether the parameter is a 
>mountpoint.
>I'll also try to fix this too.
>>
>> [ivikram@localhost ~]# btrfs fi show
>> Label: 'fedora'  uuid: d2b3420c-99c1-44cc-a922-ac266072c7fb
>>         Total devices 2 FS bytes used 33.33GiB
>>         devid    2 size 73.51GiB used 44.03GiB path /dev/sdb6
>>         devid    3 size 73.30GiB used 44.03GiB path /dev/sda2
>>
>> Label: 'Vikram'  uuid: 0809b072-35f3-4866-92b8-af4772b23ed6
>>         Total devices 2 FS bytes used 109.68GiB
>>         devid    1 size 158.03GiB used 157.00GiB path /dev/dm-0
>>         devid    2 size 157.00GiB used 157.00GiB path /dev/mapper/sdb1
>>
>I'm very sorry that I did catch the point why 'btrfs fi show' is used 
>here and what's the problem.
>It would be very nice if you can explain what's wrong with 'btrfs fi show'.
>

Sorry for the confusion. It inadvertently got added. Please ignore the
same.

The mail was only in context to btrfs fi df. Many thanks for your
kind attention to this mail. Hope the change will help everybody.

Regards,

-- 
vikram...
         ||||||||
         ||||||||
^^'''''^^||root||^^^'''''''^^
        // \\   ))
       //(( \\// \\
      // /\\ ||   \\
     || / )) ((    \\
-- 
"If you are beginning to doubt what I am saying, you are
 probably hallucinating."
-- The Firesign Theatre, _Everything you know is Wrong_
-- 
  o
 ~|~
  =

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-02 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02  5:14 btrfs fi df <mount point> outputs info instead of error even when <mount-point> is just a directory Vikram Goyal
2014-07-02  6:19 ` Qu Wenruo
2014-07-02 12:57   ` Vikram Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox