[PATCH] btrfs-progs: Enhance chunk validation check

2015-12-08 Thread Qu Wenruo
Enhance chunk validation: 1) Num_stripes We already have such check but it's only in super block sys chunk array. Now check all on-disk chunks. 2) Chunk logical It should be aligned to sector size. This behavior should be *DOUBLE CHECKED* for 64K sector size like PPC64 or

[PATCH v2] Btrfs: Check metadata redundancy on balance

2015-12-08 Thread sam tygier
Resending as previous comments did not need any changes. Currently BTRFS allows you to make bad choices of data and metadata levels. For example -d raid1 -m raid0 means you can only use half your total disk space, but will loose everything if 1 disk fails. It should give a warning in these

[PATCH v3 2/2] btrfs: Enhance chunk validation check

2015-12-08 Thread Qu Wenruo
Enhance chunk validation: 1) Num_stripes We already have such check but it's only in super block sys chunk array. Now check all on-disk chunks. 2) Chunk logical It should be aligned to sector size. This behavior should be *DOUBLE CHECKED* for 64K sector size like PPC64 or

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Austin S Hemmelgarn
On 2015-12-08 01:08, Qu Wenruo wrote: Austin S Hemmelgarn wrote on 2015/12/07 11:36 -0500: On 2015-12-07 01:06, Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Austin S Hemmelgarn
On 2015-12-07 18:06, Eric Sandeen wrote: On 12/7/15 2:54 PM, Christoph Anton Mitterer wrote: ... 2) a section that describes "ro" in btrfs-mount(5) which describes that normal "ro" alone may cause changes on the device and which then refers to hard-ro and/or the list of options (currently

Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Chandan Rajendra
On Tuesday 08 Dec 2015 14:10:33 Qu Wenruo wrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. > > Since the new parse_options() need to check new flags at remount time, > so add a new parameter

Re: [PATCH 1/4] locks: new locks_mandatory_area calling convention

2015-12-08 Thread Christoph Hellwig
On Tue, Dec 08, 2015 at 04:05:04AM +, Al Viro wrote: > Where the hell would truncate(2) get struct file, anyway? IOW, the inode > argument is _not_ pointless; re-added. Oh, right. Interestingly is seems like xfstests has no coverage of this code path at all. -- To unsubscribe from this

Re: Fixing recursive fault and parent transid verify failed

2015-12-08 Thread Duncan
Alistair Grant posted on Tue, 08 Dec 2015 06:55:04 +1100 as excerpted: > On Mon, Dec 07, 2015 at 01:48:47PM +, Duncan wrote: >> Alistair Grant posted on Mon, 07 Dec 2015 21:02:56 +1100 as excerpted: >> >> > I think I'll try the btrfs restore as a learning exercise, and to >> > check the

Scrub: no spae left on device

2015-12-08 Thread Marc MERLIN
Howdy, Why would scrub need space and why would it cancel if there isn't enough of it? (kernel 4.3) /etc/cron.daily/btrfs-scrub: btrfs scrub start -Bd /dev/mapper/cryptroot scrub device /dev/mapper/cryptroot (id 1) done scrub started at Mon Dec 7 01:35:08 2015 and finished after 258

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-08 Thread Duncan
Jon Panozzo posted on Mon, 07 Dec 2015 08:43:14 -0600 as excerpted: [On single-device dup data] > Thanks for the additional feedback. Two follow-up questions to this is: > > Can the --mixed option only be applied when first creating the fs, or > can you simply add this to the balance command

[PATCH] btrfs: don't use slab cache for struct btrfs_delalloc_work

2015-12-08 Thread David Sterba
Although we prefer to use separate caches for various structs, it seems better not to do that for struct btrfs_delalloc_work. Objects of this type are allocated rarely, when transaction commit calls btrfs_start_delalloc_roots, requesting delayed iputs. The objects are temporary (with some IO

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-08 Thread Duncan
Austin S Hemmelgarn posted on Mon, 07 Dec 2015 10:39:05 -0500 as excerpted: > On 2015-12-07 10:12, Jon Panozzo wrote: >> This is what I was thinking as well. In my particular use-case, parity >> is only really used today to reconstruct an entire device due to a >> device failure. I think if

Re: Scrub: no spae left on device

2015-12-08 Thread Lionel Bouton
Le 08/12/2015 16:06, Marc MERLIN a écrit : > Howdy, > > Why would scrub need space and why would it cancel if there isn't enough of > it? > (kernel 4.3) > > /etc/cron.daily/btrfs-scrub: > btrfs scrub start -Bd /dev/mapper/cryptroot > scrub device /dev/mapper/cryptroot (id 1) done > scrub

Re: Scrub: no spae left on device

2015-12-08 Thread Lionel Bouton
Le 08/12/2015 16:37, Holger Hoffstätte a écrit : > On 12/08/15 16:06, Marc MERLIN wrote: >> Howdy, >> >> Why would scrub need space and why would it cancel if there isn't enough of >> it? >> (kernel 4.3) >> >> /etc/cron.daily/btrfs-scrub: >> btrfs scrub start -Bd /dev/mapper/cryptroot >> scrub

Re: Scrub: no spae left on device

2015-12-08 Thread Marc MERLIN
On Tue, Dec 08, 2015 at 04:46:32PM +0100, Lionel Bouton wrote: > Le 08/12/2015 16:37, Holger Hoffstätte a écrit : > > On 12/08/15 16:06, Marc MERLIN wrote: > >> Howdy, > >> > >> Why would scrub need space and why would it cancel if there isn't enough of > >> it? > >> (kernel 4.3) > >> > >>

Re: Scrub: no spae left on device

2015-12-08 Thread Marc MERLIN
On Tue, Dec 08, 2015 at 05:24:16PM +0100, Holger Hoffstätte wrote: > On 12/08/15 17:06, Marc MERLIN wrote: > > Label: 'btrfs_pool1' uuid: 5ee24229-2431-448a-868e-2c325d10bfa7 > > Total devices 1 FS bytes used 524.26GiB > > devid1 size 615.01GiB used 614.94GiB path /dev/mapper/pool1 >

Re: Scrub: no spae left on device

2015-12-08 Thread Holger Hoffstätte
On 12/08/15 16:06, Marc MERLIN wrote: > Howdy, > > Why would scrub need space and why would it cancel if there isn't enough of > it? > (kernel 4.3) > > /etc/cron.daily/btrfs-scrub: > btrfs scrub start -Bd /dev/mapper/cryptroot > scrub device /dev/mapper/cryptroot (id 1) done > scrub

Re: Scrub: no spae left on device

2015-12-08 Thread Austin S Hemmelgarn
On 2015-12-08 10:06, Marc MERLIN wrote: Howdy, Why would scrub need space and why would it cancel if there isn't enough of it? (kernel 4.3) Wild guess here, but maybe scrub unconditionally updates the error counters, regardless of whether any errors were found or not? smime.p7s

Re: Scrub: no spae left on device

2015-12-08 Thread Holger Hoffstätte
On 12/08/15 16:46, Lionel Bouton wrote: > Le 08/12/2015 16:37, Holger Hoffstätte a écrit : >> On 12/08/15 16:06, Marc MERLIN wrote: >>> Howdy, >>> >>> Why would scrub need space and why would it cancel if there isn't enough of >>> it? >>> (kernel 4.3) >>> >>> /etc/cron.daily/btrfs-scrub: >>> btrfs

Re: [PATCH 1/4] locks: new locks_mandatory_area calling convention

2015-12-08 Thread Al Viro
On Tue, Dec 08, 2015 at 03:54:53PM +0100, Christoph Hellwig wrote: > On Tue, Dec 08, 2015 at 04:05:04AM +, Al Viro wrote: > > Where the hell would truncate(2) get struct file, anyway? IOW, the inode > > argument is _not_ pointless; re-added. > > Oh, right. Interestingly is seems like

Re: Scrub: no spae left on device

2015-12-08 Thread Holger Hoffstätte
On 12/08/15 17:06, Marc MERLIN wrote: > Label: 'btrfs_pool1' uuid: 5ee24229-2431-448a-868e-2c325d10bfa7 > Total devices 1 FS bytes used 524.26GiB > devid1 size 615.01GiB used 614.94GiB path /dev/mapper/pool1 This is what I was

Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Austin S Hemmelgarn
On 2015-12-08 01:10, Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags at remount time, so add a new parameter for parse_options().

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Christoph Anton Mitterer
On Tue, 2015-12-08 at 07:15 -0500, Austin S Hemmelgarn wrote: > Despite this, it really isn't a widely known or well documented > behavior > outside of developers, forensic specialists, and people who have had > to > deal with the implications it has on data recovery.  There really > isn't >

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-08 Thread Austin S Hemmelgarn
On 2015-12-08 14:20, Christoph Anton Mitterer wrote: On Tue, 2015-12-08 at 07:15 -0500, Austin S Hemmelgarn wrote: Despite this, it really isn't a widely known or well documented behavior outside of developers, forensic specialists, and people who have had to deal with the implications it has

btrfs scrub can neither start nor cancel

2015-12-08 Thread Wolfgang Rohdewald
I just tried this script: http://marc.merlins.org/perso/btrfs/2014-03.html#Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair but I did not pass the directory where the filesystem is mounted. Next I called it correctly: btrfs-scrub /t4 I also tried btrfs scrub start / cancel directly, but I am

Re: btrfs scrub can neither start nor cancel

2015-12-08 Thread Hugo Mills
On Tue, Dec 08, 2015 at 09:46:48PM +0100, Wolfgang Rohdewald wrote: > I just tried this script: > http://marc.merlins.org/perso/btrfs/2014-03.html#Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair > > but I did not pass the directory where the filesystem is mounted. > > Next I called it

Re: Fixing recursive fault and parent transid verify failed

2015-12-08 Thread Alistair Grant
On Tue, Dec 08, 2015 at 03:25:14PM +, Duncan wrote: > Alistair Grant posted on Tue, 08 Dec 2015 06:55:04 +1100 as excerpted: > > > On Mon, Dec 07, 2015 at 01:48:47PM +, Duncan wrote: > >> Alistair Grant posted on Mon, 07 Dec 2015 21:02:56 +1100 as excerpted: > >> > >> > I think I'll try

Re: btrfs scrub can neither start nor cancel

2015-12-08 Thread Wolfgang Rohdewald
Am Dienstag, 8. Dezember 2015, 20:51:08 schrieb Hugo Mills: > On Tue, Dec 08, 2015 at 09:46:48PM +0100, Wolfgang Rohdewald wrote: > > Anyway now I can neither cancel nor start btrfs scrub. Rebooting did not > > help. > >It might be that the userspace tools has got confused and left > behind

Re: [RFC] Btrfs device and pool management (wip)

2015-12-08 Thread Christoph Anton Mitterer
On Mon, 2015-11-30 at 13:17 -0700, Chris Murphy wrote: > On Mon, Nov 30, 2015 at 7:51 AM, Austin S Hemmelgarn > wrote: > > > General thoughts on this: > > 1. If there's a write error, we fail unconditionally right now.  It > > would be > > nice to have a configurable number

Re: [auto-]defrag, nodatacow - general suggestions?(was: btrfs: poor performance on deleting many large files?)

2015-12-08 Thread Christoph Anton Mitterer
Hey Hugo, On Thu, 2015-11-26 at 00:33 +, Hugo Mills wrote: >    Answering the second part first, no, it can't. Thanks so far :) >    The issue is that nodatacow bypasses the transactional nature of > the FS, making changes to live data immediately. This then means that > if you modify a

Re: Scrub: no spae left on device

2015-12-08 Thread Duncan
Marc MERLIN posted on Tue, 08 Dec 2015 08:06:15 -0800 as excerpted: > On Tue, Dec 08, 2015 at 04:46:32PM +0100, Lionel Bouton wrote: >> Le 08/12/2015 16:37, Holger Hoffstätte a écrit : >> > On 12/08/15 16:06, Marc MERLIN wrote: >> >> >> >> Why would scrub need space and why would it cancel if

Missing half of available space (resend)

2015-12-08 Thread David Hampton
Hi all. I'm trying to figuring out why my btrfs file system doesn't show all the available space. I currently have four 4TB drives set up as a raid6 array, so I would expect to see a total available data size slightly under 8TB (two drives for data + two drives for parity). The 'btrfs fi df'

Re: Missing half of available space (resend)

2015-12-08 Thread Chris Murphy
On Tue, Dec 8, 2015 at 10:02 PM, David Hampton wrote: > The > 'btrfs fi df' command consistently shows a total size of around 3TB, and > says that space is almost completely full. and > root@selene:~# btrfs fi df /video > Data, RAID6: total=3.15TiB, used=3.11TiB

Re: [auto-]defrag, nodatacow - general suggestions?(was: btrfs: poor performance on deleting many large files?)

2015-12-08 Thread Christoph Anton Mitterer
On 2015-11-27 00:08, Duncan wrote: > Christoph Anton Mitterer posted on Thu, 26 Nov 2015 01:23:59 +0100 as > excerpted: >> 1) AFAIU, the fragmentation problem exists especially for those files >> that see many random writes, especially, but not limited to, big files. >> Now that databases and VMs

!PageLocked BUG_ON hit in clear_page_dirty_for_io

2015-12-08 Thread Dave Jones
Not sure if I've already reported this one, but I've been seeing this a lot this last couple days. kernel BUG at mm/page-writeback.c:2654! invalid opcode: [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN CPU: 1 PID: 2566 Comm: trinity-c1 Tainted: GW 4.4.0-rc4-think+ #14 task:

Re: subvols and parents - how?

2015-12-08 Thread Christoph Anton Mitterer
On Fri, 2015-11-27 at 02:02 +, Duncan wrote: > Uhm, I don't get the big security advantage here... whether nested > > or > > manually mounted to a subdir,... if the permissions are insecure > > I'll > > have a problem... if they're secure, than not. > Consider a setuid-root binary with a

Re: attacking btrfs filesystems via UUID collisions?

2015-12-08 Thread Christoph Anton Mitterer
On Sun, 2015-12-06 at 22:34 +0800, Qu Wenruo wrote: > Not sure about LVM/MD, but they should suffer the same UUID conflict > problem. Well I had that actually quite often in LVM (i.e. same UUIDs visible on the same system), basically because we made clones from one template VM image and when that

Re: kernel call trace during send/receive

2015-12-08 Thread Christoph Anton Mitterer
Hey. Hmm I guess no one has any clue about that error? Well it seems at least that an fsck over the receiving fs passes through without any error. Cheers, Chris. On Fri, 2015-11-27 at 02:49 +0100, Christoph Anton Mitterer wrote: > Hey. > > Just got the following during send/receiving a big

Re: attacking btrfs filesystems via UUID collisions? (was: Subvolume UUID, data corruption?)

2015-12-08 Thread Christoph Anton Mitterer
On Sun, 2015-12-06 at 04:06 +, Duncan wrote: > There's actually a number of USB-based hardware and software vulns > out > there, from the under $10 common-component-capacitor-based charge- > and-zap > (charges off the 5V USB line, zaps the port with several hundred > volts > reverse-polarity,

Re: Missing half of available space (resend)

2015-12-08 Thread David Hampton
On Tue, 2015-12-08 at 22:27 -0700, Chris Murphy wrote: > On Tue, Dec 8, 2015 at 10:02 PM, David Hampton > wrote: > > The > > 'btrfs fi df' command consistently shows a total size of around > > 3TB, and says that space is almost completely full. > > and > > > >

Re: subvols and parents - how?

2015-12-08 Thread Christoph Anton Mitterer
On Fri, 2015-11-27 at 01:02 +, Duncan wrote: [snip snap] > #1 could be a pain to setup if you weren't actually mounting it > previously, just relying on the nested tree, AND... > > #2 The point I was trying to make, now, to mount it you'll mount not > a > native nested subvol, and not a