Re: btrfs fi du -s gives Inappropriate ioctl for device

2017-08-18 Thread Piotr Szymaniak
On Thu, Aug 17, 2017 at 10:59:33PM +0200, Goffredo Baroncelli wrote:
> Patches will follow shortly

With your patches applied:

~ # btrfs fi du -s /mnt/red/\@backup/ 
/mnt/red/\@backup/.snapshot/monthly_2017-08-01_05\:30\:01/ /mnt/red/\@svn/ 
/mnt/red/\@svn/.snapshot/weekly_2017-08-05_04\:20\:02/
 Total   Exclusive  Set shared  Filename
   1.86TiB75.73MiB   312.77GiB  /mnt/red/@backup/
 320.29GiB   0.00B   312.19GiB  
/mnt/red/@backup/.snapshot/monthly_2017-08-01_05:30:01/
  52.24GiB10.19MiB 4.13GiB  /mnt/red/@svn/
   4.35GiB 1.05MiB 4.12GiB  
/mnt/red/@svn/.snapshot/weekly_2017-08-05_04:20:02/


Best regards,
Piotr Szymaniak.
-- 
Mysle,  ze gdyby  diabel  nie istnial i mialby go stworzyc czlowiek, to
stworzylby go na swoj obraz i podobienstwo.
  -- Fiodor Dostojewski


signature.asc
Description: Digital signature


Re: btrfs fi du -s gives Inappropriate ioctl for device

2017-08-16 Thread Piotr Szymaniak
On Mon, Aug 14, 2017 at 05:40:30PM -0600, Chris Murphy wrote:
> On Mon, Aug 14, 2017 at 4:57 PM, Piotr Szymaniak <szar...@grubelek.pl> wrote:
> 
> >
> > and... some issues:
> > ~ # btrfs fi du -s /mnt/red/\@backup/
> >  Total   Exclusive  Set shared  Filename
> > ERROR: cannot check space of '/mnt/red/@backup/': Inappropriate ioctl for 
> > device
> 
> 
> It's a bug, but I don't know if any devs are working on a fix yet.
> 
> The problem is that the subvolume being snapshot, contains subvolumes.
> The resulting snapshot, contains an empty directory in place of the
> nested subvolume(s), and that is the cause for the error.

Ok, but why, on the same btrfs, it works on some subvols with subvols and does
not work on other subvols with subvols? If it does not work - OK, if it works -
OK, but that seems a bit... random?

~ # btrfs fi du -s /mnt/red/\@backup/ 
/mnt/red/\@backup/.snapshot/monthly_2017-08-01_05\:30\:01/ /mnt/red/\@svn/ 
/mnt/red/\@svn/.snapshot/weekly_2017-08-05_04\:20\:02/
 Total   Exclusive  Set shared  Filename
ERROR: cannot check space of '/mnt/red/@backup/': Inappropriate ioctl for device
ERROR: cannot check space of 
'/mnt/red/@backup/.snapshot/monthly_2017-08-01_05:30:01/': Inappropriate ioctl 
for device
  52.23GiB10.57MiB 4.13GiB  /mnt/red/@svn/
   4.35GiB 1.03MiB 4.12GiB  
/mnt/red/@svn/.snapshot/weekly_2017-08-05_04:20:02/


Best regards,
Piotr Szymaniak.


signature.asc
Description: Digital signature


btrfs fi du -s gives Inappropriate ioctl for device

2017-08-14 Thread Piotr Szymaniak
Hi list,

I have some weird issue.

So, I have btrfs fs and some subvols, like that:
~ # btrfs sub list /mnt/red/
ID 260 gen 827956 top level 5 path @home
ID 261 gen 827926 top level 5 path @backup
ID 645 gen 827911 top level 5 path @svn
*snip*

and some snapshots on those subvols:
*snip*
ID 2501 gen 827894 top level 260 path 
@home/.snapshot/monthly_2017-05-01_05:30:01
ID 2603 gen 827894 top level 260 path 
@home/.snapshot/monthly_2017-06-01_05:30:01
ID 2604 gen 827927 top level 261 path 
@backup/.snapshot/monthly_2017-06-01_05:30:02
ID 2680 gen 827895 top level 260 path 
@home/.snapshot/monthly_2017-07-01_05:30:01
ID 2681 gen 827927 top level 261 path 
@backup/.snapshot/monthly_2017-07-01_05:30:01
ID 2734 gen 827895 top level 260 path @home/.snapshot/weekly_2017-07-22_04:20:01
ID 2735 gen 827905 top level 645 path @svn/.snapshot/weekly_2017-07-22_04:20:02
ID 2754 gen 827895 top level 260 path @home/.snapshot/weekly_2017-07-29_04:20:01
ID 2755 gen 827906 top level 645 path @svn/.snapshot/weekly_2017-07-29_04:20:01
ID 2763 gen 827896 top level 260 path 
@home/.snapshot/monthly_2017-08-01_05:30:01
*snip*

and... some issues:
~ # btrfs fi du -s /mnt/red/\@backup/
 Total   Exclusive  Set shared  Filename
ERROR: cannot check space of '/mnt/red/@backup/': Inappropriate ioctl for device

and it works for other subvols:
~ # btrfs fi du -s /mnt/red/\@svn/
 Total   Exclusive  Set shared  Filename
  52.22GiB10.59MiB 4.13GiB  /mnt/red/@svn/

~ # btrfs fi du -s /mnt/red/\@home/
 Total   Exclusive  Set shared  Filename
   2.08TiB 4.54GiB   124.51GiB  /mnt/red/@home/

on the other hand, those values also look wrong (2.08TiB?):
~ # btrfs fi df /mnt/red/\@home/
Data, RAID1: total=448.00GiB, used=447.39GiB
System, RAID1: total=32.00MiB, used=80.00KiB
Metadata, RAID1: total=3.00GiB, used=2.02GiB
GlobalReserve, single: total=512.00MiB, used=0.00B

~ # btrfs fi usage /mnt/red/\@home/
Overall:
Device size:   1.36TiB
Device allocated:902.06GiB
Device unallocated:  493.21GiB
Device missing:  0.00B
Used:898.81GiB
Free (estimated):247.22GiB  (min: 247.22GiB)
Data ratio:   2.00
Metadata ratio:   2.00
Global reserve:  512.00MiB  (used: 0.00B)

Data,RAID1: Size:448.00GiB, Used:447.39GiB
   /dev/mapper/wd0   448.00GiB
   /dev/mapper/wd1   448.00GiB

Metadata,RAID1: Size:3.00GiB, Used:2.02GiB
   /dev/mapper/wd0 3.00GiB
   /dev/mapper/wd1 3.00GiB

System,RAID1: Size:32.00MiB, Used:80.00KiB
   /dev/mapper/wd032.00MiB
   /dev/mapper/wd132.00MiB

Unallocated:
   /dev/mapper/wd0   246.60GiB
   /dev/mapper/wd1   246.60GiB

~ # uname -sr
Linux 4.4.76

~ # btrfs --version
btrfs-progs v4.12

Whats wrong with one of my subvols? Whats wrong with space reported by fi du?


Best regards,
Piotr Szymaniak.


signature.asc
Description: Digital signature


Re: btrfs balance {,meta}data to raid5 not working?

2015-04-14 Thread Piotr Szymaniak
On Sat, Apr 11, 2015 at 02:14:44AM +, Duncan wrote:
 But you could try the latest 4.0-rc7+ kernel and see if it works with 
 that, yet.

Will try that.


 2b) If instead your intention was to convert it to raid5 before upgrading 
 it to three devices, just add the third device first, then do the balance-
 conversion.  It'll save quite some time over effectively doing the 
 balance-conversion twice.

I want to grow it later to 3 or 4 devices. Now it is still a test setup
and I want to try convert to raid5 and also check +- time it takes (and
if it will end OK).


Piotr Szymaniak.
-- 
 - Zamówiłeś baby-sitterkę? - chciała wiedzieć Maggie.
  -- Graham Masterton, Zaklęci (przełożył Juliusz Garztecki)


signature.asc
Description: Digital signature


btrfs balance {,meta}data to raid5 not working?

2015-04-10 Thread Piotr Szymaniak
Hi,

I tried today to balance two drive btrfs raid1 to two drive btrfs raid5
without luck:

~ # btrfs balance start -dconvert=raid5 -mconvert=raid5 /mnt/cdrom/
ERROR: error during balancing '/mnt/cdrom/' - Invalid argument
There may be more info in syslog - try dmesg | tail
~ # btrfs balance start -mconvert=raid5 /mnt/cdrom/
ERROR: error during balancing '/mnt/cdrom/' - Invalid argument
There may be more info in syslog - try dmesg | tail
~ # btrfs balance start -dconvert=raid5 /mnt/cdrom/
ERROR: error during balancing '/mnt/cdrom/' - Invalid argument
There may be more info in syslog - try dmesg | tail
~ # dmesg | tail -3
[57073.050249] BTRFS error (device sdd): unable to start balance with
target data profile 128
[57079.674386] BTRFS error (device sdd): unable to start balance with
target metadata profile 128
[57082.754136] BTRFS error (device sdd): unable to start balance with
target data profile 128

Linux 3.19.3
btrfs-progs v3.19.1


Piotr Szymaniak.
-- 
Nie wierze,  zeby wyslali cie tam, nie w tym kraju, gdzie zabojcom daje
sie  po lapie i po dwoch latach ogladania kolorowej telewizji w wiezie-
niu znow wypuszcza na ulice, zeby mogli zabijac.
  -- Stephen King, Apt Pupil


signature.asc
Description: Digital signature


Re: snapshot space use

2015-04-09 Thread Piotr Szymaniak
On Thu, Apr 09, 2015 at 08:45:21AM +0800, Qu Wenruo wrote:
 *snip*
 NOTE: quota is not so stable and has some problem, but should give
 you enough info.

Those are related to actually using quota or can also hit you when you
want to use it just for things like this snapshot space use?


Piotr Szymaniak.
-- 
  - Oo,  jesteś  bystrzejszy,  niż  się  wydaje.  Przechodziłeś  jakieś
szkolenie antyterrorystyczne?
  - W pewnym sensie tak. Byłem żonaty.
 -- Nelson DeMille, The Lion's Game


signature.asc
Description: Digital signature


Re: Using two mirrored drives separately

2014-09-20 Thread Piotr Szymaniak
On Sat, Sep 20, 2014 at 07:11:52PM +0300, Leonid Bloch wrote:
 I am wondering: if I set up btrfs on two identical drives, with data
 and metadata mirroring, will it be possible to use these drives
 separately later on? Will just one of these drives work as a regular
 btrfs-formatted single drive if connected to a different machine?

If by this you mean btrfs raid1, then yes, they will work this way. Just
both of them will have missing device and, afaik, wont mount without
-o degraded. But then you can rebalance to notraid1 or add another disk
and replace missing devices on new machines.


Piotr Szymaniak.


signature.asc
Description: Digital signature


Re: Can btrfs re-sync an out-of-sync RAID1 filesystem?

2014-09-17 Thread Piotr Szymaniak
On Wed, Sep 17, 2014 at 10:13:01AM -0700, Alan Hagge wrote:
 I know that sounds weird, but here's my scenario:

There was similar thread [1] few days ago, you should take a look at it.

[1] https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg37144.html


Piotr Szymaniak.
-- 
I ten smród. Diabli wiedzą, co tam gniło, w tym mięsiwie, ale Redowi
wydało się, że sto tysięcy rozbitych cuchnących jaj wylanych na sto
tysięcy cuchnących rybich łbów i zdechłych kotów nie może śmierdzieć
tak, jak śmierdziała ta maź.
 -- Arkadij i Borys Strugaccy, „Piknik na skraju drogi”


signature.asc
Description: Digital signature


Re: ENOSPC errors during balance

2014-07-19 Thread Piotr Szymaniak
On Sat, Jul 19, 2014 at 11:38:08AM -0600, Chris Murphy wrote:
 [96241.882138] ata2.00: exception Emask 0x1 SAct 0x7ffe0fff SErr 0x0 action 
 0x6 frozen
 [96241.882139] ata2.00: Ata error. fis:0x21
 [96241.882142] ata2.00: failed command: READ FPDMA QUEUED
 [96241.882148] ata2.00: cmd 60/08:00:68:0a:2d/00:00:18:00:00/40 tag 0 ncq 
 4096 in
  res 41/00:58:40:5c:2c/00:00:18:00:00/40 Emask 0x1 (device error)

Afair those are somehow related to NCQ.


Piotr Szymaniak.
-- 
Komnata  audiencyjna  zlotego  Bruna  przerastala  wszystko,  co  dotad
widzialem.  Musial  zatrudnic  dziesiatki  programistow i kreatorow, by
stworzyc tak wyuzdane i wysmakowane  wnetrze.  Dzwieki, barwy, ksztalty
i zapachy wywolywaly erekcje.
  -- Marcin Przybylek, Gamedec: Syndrom Adelheima


signature.asc
Description: Digital signature


Re: [PATCH] btrfs file write debugging patch

2011-03-01 Thread Piotr Szymaniak
On Mon, Feb 28, 2011 at 02:20:22PM -0600, Mitch Harder wrote:
 As promised, I'm put together a modified file.c with many trace_printk
 debugging statements to augment the ftrace.
 *snip*

Just my few cents. I've applied the patch from Chris Mason (Sun, 27 Feb
2011 20:46:05 -0500) and this one from Mitch (Mon, 28 Feb 2011 14:20:22
-0600) on top of vanilla 2.6.38-rc6 and it seems that it resolves my
issues with hanging `svn info' during libgcrypt emerge.

Piotr Szymaniak.
-- 
 - (...) Nie wyobrazam sobie, co ta gora miesa moglaby ci dac, czego ja
nie   moglbym   ofiarowac.  Oczywiscie  poza  piecdziesiecioma  funtami
rozrosnietych miesni.
 - Moze mnie wlasnie pociagaja rozrosniete miesnie. (...) W koncu wielu
mezczyzn pociaga rozrosnieta tkanka tluszczowa piersi.
  -- Graham Masterton, The Wells of Hell


pgp0s4aN9vbmU.pgp
Description: PGP signature


Re: [PATCH v2]Btrfs: pwrite blocked when writing from the mmaped buffer of the same page

2011-02-24 Thread Piotr Szymaniak
On Mon, Feb 21, 2011 at 09:51:11AM +0800, Zhong, Xin wrote:
 The backtrace in your attachment looks like a known bug of 2.6.37 which have 
 already been fixed in 2.6.38. I have no idea why latest btrfs still hang in 
 your environment if there's no debug info...

Hi list.

I'm watching this list for a while because it seems, that I'm also
affected by this bug. In the archives I found someone with Gentoo system
with freezing `svn info' (thats why I joined). Well, seems that I have 
same issue here.

Attached latest _rc kernel sysrq+t output (first part when the `svn
info' freezed on libgcrypt, and second after ctrl+c that emerge).

Seems that my backtrace is small compared to Marias. I'm missing some
features in kernel to get larger backtraces?

Piotr Szymaniak.



 -Original Message-
 From: Maria Wikström [mailto:ma...@ponstudios.se] 
 Sent: Friday, February 18, 2011 7:32 PM
 To: Zhong, Xin
 Cc: Johannes Hirte; linux-btrfs@vger.kernel.org
 Subject: RE: [PATCH v2]Btrfs: pwrite blocked when writing from the mmaped 
 buffer of the same page
 
 
 Seems like my reply got eaten by the lists spam filter, so I resend with 
 attachment compressed. Should have thought of that :p
 
 
 fre 2011-02-11 klockan 12:39 +0800 skrev Zhong, Xin:
  Hi,
  
  Could you paste the output of sysrq+t here? Thanks!
 
 Yes, it's in the attachment. I tried latest btrfs from git (last commit Mon 
 Feb 14 00:45:29 2011 +) but it hang so bad that I couldn't get the output 
 from sysrq+t to hit the disk. So the output is from vanilla
 2.6.37 
 
 // Maria
 
  -Original Message-
  From: Johannes Hirte [mailto:johannes.hi...@fem.tu-ilmenau.de]
  Sent: Wednesday, February 02, 2011 7:35 AM
  To: Zhong, Xin
  Cc: Maria Wikström; linux-btrfs@vger.kernel.org
  Subject: Re: [PATCH v2]Btrfs: pwrite blocked when writing from the 
  mmaped buffer of the same page
  
  On Friday 28 January 2011 04:53:24 Zhong, Xin wrote:
   Could you describe the steps to recreate it?
   It will be a great help for me to look further. Thanks!
  
  It's a little strange. I have to systems with btrfs, both 
  Gentoo-based. One is affected by this bug the other is not. On the 
  affected system it is enough to do a 'emerge dev-libs/libgcrypt' that 
  should normaly compile and install libgcrypt. The emerge command is 
  part of portage, the package management of Gentoo.
  The strace output looks similar to the one from Maria:
  
 
 N?r??yb?X??ǧv?^?)޺{.n?+{?n?߲)w*jg????ݢj/???z?ޖ??2?ޙ?)ߡ?a?????G???h??j:+v???w??٥

-- 
Druzyna  futbolowa  tutaj  jest  do  niczego, ale ucze sie troche pilki
noznej.  Trener  mowi,  ze  pilka nozna to futbol dla inteligentnych, a
futbol to futbol dla kretynow.
  -- Stephen King, The Dead Zone


vanilla-2.6.38-rc6_sysrq-t.bz2
Description: BZip2 compressed data


pgpwOlW7jCAZg.pgp
Description: PGP signature