All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs-progs 4.0 breaks btrfs fi show?
@ 2015-05-06  7:23 Chris Murphy
  2015-05-06  8:12 ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Murphy @ 2015-05-06  7:23 UTC (permalink / raw)
  To: Btrfs BTRFS

Since the 4.0 update, fi show only gives me a version number. Anyone else?

btrfs-progs-4.0-1.fc22.x86_64
kernel-4.0.1-300.fc22.x86_64


-- 
Chris Murphy

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06  7:23 btrfs-progs 4.0 breaks btrfs fi show? Chris Murphy
@ 2015-05-06  8:12 ` Qu Wenruo
  2015-05-06  8:34   ` Anand Jain
       [not found]   ` <CAJCQCtT0ff8fVrMQ7rrgW1VFkiBL+f_upGOUZ7DY65N62jAsBQ@mail.gmail.com>
  0 siblings, 2 replies; 11+ messages in thread
From: Qu Wenruo @ 2015-05-06  8:12 UTC (permalink / raw)
  To: Chris Murphy, Btrfs BTRFS

Works for me.
Although with a lot of annoying extra missing device warning:
------
$ sudo btrfs fi show
warning, device 1 is missing
warning, device 4 is missing
warning, device 3 is missing
warning, device 2 is missing
warning, device 1 is missing
warning devid 1 not found already
warning devid 2 not found already
warning devid 3 not found already
warning devid 4 not found already
bytenr mismatch, want=40222720, have=0
Couldn't read tree root
warning, device 1 is missing
warning, device 1 is missing
warning devid 1 not found already
Label: none  uuid: 7d57b997-1e84-4daf-a99c-a0339d268112
	Total devices 5 FS bytes used 6.98MiB
	devid    5 size 10.00GiB used 1.80GiB path /dev/sda6
	*** Some devices missing

Label: none  uuid: 54e051a4-0a9b-4ec5-b8bf-cecdd1ec6620
	Total devices 1 FS bytes used 991.94MiB
	devid    1 size 10.00GiB used 3.04GiB path /dev/sdb

Label: none  uuid: 2b4ca7ea-061a-4784-b2de-c7d6341ef8a0
	Total devices 1 FS bytes used 384.00KiB
	devid    1 size 15.00GiB used 2.04GiB path /dev/sdc

Label: none  uuid: c5a72536-5319-465e-81b6-a03468daab8a
	Total devices 4 FS bytes used 15.29MiB
	devid    2 size 10.00GiB used 2.01GiB path /dev/sdg
	devid    3 size 10.00GiB used 2.01GiB path /dev/sde
	devid    4 size 10.00GiB used 2.01GiB path /dev/sdf
	*** Some devices missing

btrfs-progs v4.0
------

Would you please give some detail of your problem?
Like the options and arguments.

Thanks,
Qu

-------- Original Message  --------
Subject: btrfs-progs 4.0 breaks btrfs fi show?
From: Chris Murphy <lists@colorremedies.com>
To: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Date: 2015年05月06日 15:23

> Since the 4.0 update, fi show only gives me a version number. Anyone else?
>
> btrfs-progs-4.0-1.fc22.x86_64
> kernel-4.0.1-300.fc22.x86_64
>
>

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06  8:12 ` Qu Wenruo
@ 2015-05-06  8:34   ` Anand Jain
  2015-05-06 15:07     ` David Sterba
       [not found]   ` <CAJCQCtT0ff8fVrMQ7rrgW1VFkiBL+f_upGOUZ7DY65N62jAsBQ@mail.gmail.com>
  1 sibling, 1 reply; 11+ messages in thread
From: Anand Jain @ 2015-05-06  8:34 UTC (permalink / raw)
  To: Qu Wenruo, Chris Murphy, Btrfs BTRFS



Thanks Qu for confirming it working in 4.x. It put me on my toes
for a while, and I am still upgrading my ws.


On 05/06/2015 04:12 PM, Qu Wenruo wrote:
> Works for me.
> Although with a lot of annoying extra missing device warning:

Yep. Its from 915902c5002485fb13d27c4b699a73fb66cc0f09
after various objections I made it still got in.


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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
       [not found]   ` <CAJCQCtT0ff8fVrMQ7rrgW1VFkiBL+f_upGOUZ7DY65N62jAsBQ@mail.gmail.com>
@ 2015-05-06  9:31     ` Qu Wenruo
  2015-05-06 15:52       ` Chris Murphy
  0 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2015-05-06  9:31 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS, anonymous_temp_mail

Maybe the default kernel probe routine has some problem?

Would you please try 'btrfs fi show <device>' to test the offline
probe routine?
Also, did you update your kernel and didn't reboot?

P.S. Add CC to one of my personal mail address to this case.

Thanks,
Qu

-------- Original Message  --------
Subject: Re: btrfs-progs 4.0 breaks btrfs fi show?
From: Chris Murphy <lists@colorremedies.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2015年05月06日 17:27

>
> On May 6, 2015 2:12 AM, "Qu Wenruo" <quwenruo@cn.fujitsu.com
> <mailto:quwenruo@cn.fujitsu.com>> wrote:
>  >
>  > Would you please give some detail of your problem?
>  > Like the options and arguments.
>
> I usually use it without arguments, but with 4.0 the arguments don't matter.
>
> # btrfs fi show
> btrfs-progs v4.0
> # btrfs fi show /
> btrfs-progs v4.0
>
> I get nothing else.
>
> Chris Murphy
>

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06  8:34   ` Anand Jain
@ 2015-05-06 15:07     ` David Sterba
  2015-05-06 15:27       ` David Sterba
  0 siblings, 1 reply; 11+ messages in thread
From: David Sterba @ 2015-05-06 15:07 UTC (permalink / raw)
  To: Anand Jain; +Cc: Qu Wenruo, Chris Murphy, Btrfs BTRFS

On Wed, May 06, 2015 at 04:34:23PM +0800, Anand Jain wrote:
> On 05/06/2015 04:12 PM, Qu Wenruo wrote:
> > Works for me.
> > Although with a lot of annoying extra missing device warning:
> 
> Yep. Its from 915902c5002485fb13d27c4b699a73fb66cc0f09
> after various objections I made it still got in.

I don't see this commit id in my git, what's the patch subject?

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06 15:07     ` David Sterba
@ 2015-05-06 15:27       ` David Sterba
  0 siblings, 0 replies; 11+ messages in thread
From: David Sterba @ 2015-05-06 15:27 UTC (permalink / raw)
  To: dsterba, Anand Jain, Qu Wenruo, Chris Murphy, Btrfs BTRFS

On Wed, May 06, 2015 at 05:07:27PM +0200, David Sterba wrote:
> On Wed, May 06, 2015 at 04:34:23PM +0800, Anand Jain wrote:
> > On 05/06/2015 04:12 PM, Qu Wenruo wrote:
> > > Works for me.
> > > Although with a lot of annoying extra missing device warning:
> > 
> > Yep. Its from 915902c5002485fb13d27c4b699a73fb66cc0f09
> > after various objections I made it still got in.
> 
> I don't see this commit id in my git, what's the patch subject?

Found by other means "btrfs-progs: fix device missing of btrfs fi show
with seed devices", merged into 3.17.

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06  9:31     ` Qu Wenruo
@ 2015-05-06 15:52       ` Chris Murphy
  2015-05-06 17:05         ` Chris Murphy
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Murphy @ 2015-05-06 15:52 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Chris Murphy, Btrfs BTRFS, anonymous_temp_mail

On Wed, May 6, 2015 at 3:31 AM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
> Maybe the default kernel probe routine has some problem?
>
> Would you please try 'btrfs fi show <device>' to test the offline
> probe routine?
> Also, did you update your kernel and didn't reboot?
>
> P.S. Add CC to one of my personal mail address to this case.

*sigh* no much more stupid user error than that: I wasn't root but
thought I was. Obviously it was too late and I should have going to
bed before hitting Send.

So it works fine so long as the user is too.



-- 
Chris Murphy

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06 15:52       ` Chris Murphy
@ 2015-05-06 17:05         ` Chris Murphy
  2015-05-06 17:32           ` Austin S Hemmelgarn
  2015-05-07 14:14           ` David Sterba
  0 siblings, 2 replies; 11+ messages in thread
From: Chris Murphy @ 2015-05-06 17:05 UTC (permalink / raw)
  Cc: Qu Wenruo, Btrfs BTRFS, anonymous_temp_mail

Ok so now that my mea culpa is out of the way, I'm actually wondering
why non-root users can't do certain btrfs tasks when they're read-only
commands.

[chris@f22m ~]$ btrfs fi show
ERROR: could not open /dev/sda7   ##this is new it wasn't doing this last night
btrfs-progs v4.0
[chris@f22m ~]$ btrfs fi df /
Data, single: total=4.00GiB, used=3.57GiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=1.01GiB, used=198.30MiB
GlobalReserve, single: total=80.00MiB, used=0.00B
[chris@f22m ~]$ btrfs fi usage /
WARNING: can't read detailed chunk info, RAID5/6 numbers will be
incorrect, run as root
WARNING: can't get filesystem info from ioctl(FS_INFO), run as root
ERROR: couldn't get space info on '/' - Operation not permitted


I think usage is more useful than df for users, and contains largely
the same information as df + show, so I think all three should be
non-root user usable.

---
Chris Murphy

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06 17:05         ` Chris Murphy
@ 2015-05-06 17:32           ` Austin S Hemmelgarn
  2015-05-06 17:48             ` Hugo Mills
  2015-05-07 14:14           ` David Sterba
  1 sibling, 1 reply; 11+ messages in thread
From: Austin S Hemmelgarn @ 2015-05-06 17:32 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Qu Wenruo, Btrfs BTRFS

[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]

On 2015-05-06 13:05, Chris Murphy wrote:
> Ok so now that my mea culpa is out of the way, I'm actually wondering
> why non-root users can't do certain btrfs tasks when they're read-only
> commands.
>
> [chris@f22m ~]$ btrfs fi show
> ERROR: could not open /dev/sda7   ##this is new it wasn't doing this last night
> btrfs-progs v4.0
> [chris@f22m ~]$ btrfs fi df /
> Data, single: total=4.00GiB, used=3.57GiB
> System, single: total=4.00MiB, used=16.00KiB
> Metadata, single: total=1.01GiB, used=198.30MiB
> GlobalReserve, single: total=80.00MiB, used=0.00B
> [chris@f22m ~]$ btrfs fi usage /
> WARNING: can't read detailed chunk info, RAID5/6 numbers will be
> incorrect, run as root
> WARNING: can't get filesystem info from ioctl(FS_INFO), run as root
> ERROR: couldn't get space info on '/' - Operation not permitted
>
>
> I think usage is more useful than df for users, and contains largely
> the same information as df + show, so I think all three should be
> non-root user usable.
>
That may be tricky to do, I think show and usage both access the 
underlying block device directly (or try to in any case), which would 
explain why they don't work as non-root; most modern linux distributions 
have permissions on (non-hot-plugged) block devices set to 660 and owned 
by root:disk.



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2967 bytes --]

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06 17:32           ` Austin S Hemmelgarn
@ 2015-05-06 17:48             ` Hugo Mills
  0 siblings, 0 replies; 11+ messages in thread
From: Hugo Mills @ 2015-05-06 17:48 UTC (permalink / raw)
  To: Austin S Hemmelgarn; +Cc: Chris Murphy, Qu Wenruo, Btrfs BTRFS

[-- Attachment #1: Type: text/plain, Size: 2778 bytes --]

On Wed, May 06, 2015 at 01:32:02PM -0400, Austin S Hemmelgarn wrote:
> On 2015-05-06 13:05, Chris Murphy wrote:
> >Ok so now that my mea culpa is out of the way, I'm actually wondering
> >why non-root users can't do certain btrfs tasks when they're read-only
> >commands.
> >
> >[chris@f22m ~]$ btrfs fi show
> >ERROR: could not open /dev/sda7   ##this is new it wasn't doing this last night
> >btrfs-progs v4.0
> >[chris@f22m ~]$ btrfs fi df /
> >Data, single: total=4.00GiB, used=3.57GiB
> >System, single: total=4.00MiB, used=16.00KiB
> >Metadata, single: total=1.01GiB, used=198.30MiB
> >GlobalReserve, single: total=80.00MiB, used=0.00B
> >[chris@f22m ~]$ btrfs fi usage /
> >WARNING: can't read detailed chunk info, RAID5/6 numbers will be
> >incorrect, run as root
> >WARNING: can't get filesystem info from ioctl(FS_INFO), run as root
> >ERROR: couldn't get space info on '/' - Operation not permitted
> >
> >
> >I think usage is more useful than df for users, and contains largely
> >the same information as df + show, so I think all three should be
> >non-root user usable.
> >
> That may be tricky to do, I think show and usage both access the
> underlying block device directly (or try to in any case), which
> would explain why they don't work as non-root; most modern linux
> distributions have permissions on (non-hot-plugged) block devices
> set to 660 and owned by root:disk.

   show certainly does, because it scans for devices, like btrfs dev
scan does. I think Anand has attempted to make it report data from the
kernel's internal FS table, but I'm not sure about the status of that
(and, TBH, not entirely sure about whether it exists. I may have got
the wrong end of the stick skimming through that patch set and
discussion).

   usage shouldn't need to access the device directly, but probably
does need to access the tree search ioctl. It's not the only tool that
does that, and that's probably the reason for most of the root-only
btrfs commands.

   I suspect that in most cases, there's no particularly good reason
for the use of TREE_SEARCH, other than it would require yet another
btrfs-specific ioctl to get the information out without handing the
entire FS's metadata to non-root users. TREE_SEARCH is great for
extracting random data from the FS, and is a really good way to hack
together a new userspace informational feature, but it does then mean
that you can't offer that feature to users that don't have root
permissions.

   Hugo.

-- 
Hugo Mills             | We don't just borrow words; on occasion, English has
hugo@... carfax.org.uk | pursued other languages down alleyways to beat them
http://carfax.org.uk/  | unconscious and rifle their pockets for new
PGP: E2AB1DE4          | vocabulary.                           James D. Nicoll

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: btrfs-progs 4.0 breaks btrfs fi show?
  2015-05-06 17:05         ` Chris Murphy
  2015-05-06 17:32           ` Austin S Hemmelgarn
@ 2015-05-07 14:14           ` David Sterba
  1 sibling, 0 replies; 11+ messages in thread
From: David Sterba @ 2015-05-07 14:14 UTC (permalink / raw)
  To: Chris Murphy; +Cc: quwenruo, Btrfs BTRFS, anonymous_temp_mail

On Wed, May 06, 2015 at 11:05:20AM -0600, Chris Murphy wrote:
> Ok so now that my mea culpa is out of the way, I'm actually wondering
> why non-root users can't do certain btrfs tasks when they're read-only
> commands.
> 
> [chris@f22m ~]$ btrfs fi show
> ERROR: could not open /dev/sda7   ##this is new it wasn't doing this last night
> btrfs-progs v4.0
> [chris@f22m ~]$ btrfs fi df /
> Data, single: total=4.00GiB, used=3.57GiB
> System, single: total=4.00MiB, used=16.00KiB
> Metadata, single: total=1.01GiB, used=198.30MiB
> GlobalReserve, single: total=80.00MiB, used=0.00B
> [chris@f22m ~]$ btrfs fi usage /
> WARNING: can't read detailed chunk info, RAID5/6 numbers will be
> incorrect, run as root
> WARNING: can't get filesystem info from ioctl(FS_INFO), run as root
> ERROR: couldn't get space info on '/' - Operation not permitted
> 
> 
> I think usage is more useful than df for users, and contains largely
> the same information as df + show, so I think all three should be
> non-root user usable.

The raid56 info is obtained through the search ioctl that's available
only to root (as Hugo explained in another mail).

The FS_INFO ioctl is unnecessarily root-only in kernels up to 3.15.

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

end of thread, other threads:[~2015-05-07 14:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06  7:23 btrfs-progs 4.0 breaks btrfs fi show? Chris Murphy
2015-05-06  8:12 ` Qu Wenruo
2015-05-06  8:34   ` Anand Jain
2015-05-06 15:07     ` David Sterba
2015-05-06 15:27       ` David Sterba
     [not found]   ` <CAJCQCtT0ff8fVrMQ7rrgW1VFkiBL+f_upGOUZ7DY65N62jAsBQ@mail.gmail.com>
2015-05-06  9:31     ` Qu Wenruo
2015-05-06 15:52       ` Chris Murphy
2015-05-06 17:05         ` Chris Murphy
2015-05-06 17:32           ` Austin S Hemmelgarn
2015-05-06 17:48             ` Hugo Mills
2015-05-07 14:14           ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.