Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Ingo Molnar
* Linus Torvalds wrote: > So an error message like > >warning: ISO C90 requires array sizes to be constant-expressions > > would be technically correct and useful from a portability angle. It > tells you when you're doing something non-portable, and should be > automatically enabled with "

Raid1 volume stuck as read-only: How to dump, recreate and restore its content?

2018-03-11 Thread Andreas Hild
Dear All, Following a physical disk failure of a RAID1 array, I tried to mount the remaining volume of a root partition with "-o degraded". For some reason it ended up as read-only as described here: https://btrfs.wiki.kernel.org/index.php/Gotchas#raid1_volumes_only_mountable_once_RW_if_degraded

Re: Raid1 volume stuck as read-only: How to dump, recreate and restore its content?

2018-03-11 Thread Adam Borowski
On Sun, Mar 11, 2018 at 11:28:08PM +0700, Andreas Hild wrote: > Following a physical disk failure of a RAID1 array, I tried to mount > the remaining volume of a root partition with "-o degraded". For some > reason it ended up as read-only as described here: > https://btrfs.wiki.kernel.org/index.php

Re: Ongoing Btrfs stability issues

2018-03-11 Thread Goffredo Baroncelli
On 03/10/2018 03:29 PM, Christoph Anton Mitterer wrote: > On Sat, 2018-03-10 at 14:04 +0200, Nikolay Borisov wrote: >> So for OLTP workloads you definitely want nodatacow enabled, bear in >> mind this also disables crc checksumming, but your db engine should >> already have such functionality imple

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Linus Torvalds
On Sun, Mar 11, 2018 at 4:05 AM, Ingo Molnar wrote: > > BTW., while I fully agree with everything you said, it's not entirely correct > to > claim that if a C compiler can generate VLA code it is necessarily able to > parse > and evaluate constant array sizes "just fine". > > Constant expression

Re: Ongoing Btrfs stability issues

2018-03-11 Thread Christoph Anton Mitterer
On Sun, 2018-03-11 at 18:51 +0100, Goffredo Baroncelli wrote: > > COW is needed to properly checksum the data. Otherwise is not > possible to ensure the coherency between data and checksum (however I > have to point out that BTRFS fails even in this case [*]). > We could rearrange this sentence, s

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 01:10:30PM -0800, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 12:05 PM, Kees Cook wrote: > > When max() is used in stack array size calculations from literal values > > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > > thinks this is a dynamic cal

Re: [PATCH v2] btrfs-progs: dump-tree: add degraded option

2018-03-11 Thread Qu Wenruo
On 2018年03月10日 21:54, Anand Jain wrote: > btrfs inspect dump-tree cli picks the disk with the largest generation > to read the root tree, even when all the devices were not provided in > the cli. But in 2 disks RAID1 you may need to know what's in the disks > individually, so this option -x | --n

Re: [PATCH 13/20] btrfs-progs: use cmd_struct as command entry point

2018-03-11 Thread Jeff Mahoney
On 3/7/18 9:40 PM, je...@suse.com wrote: > From: Jeff Mahoney > diff --git a/cmds-inspect.c b/cmds-inspect.c > index afd7fe48..12f200b3 100644 > --- a/cmds-inspect.c > +++ b/cmds-inspect.c > @@ -625,33 +629,27 @@ static int cmd_inspect_min_dev_size(int argc, char > **argv) > out: > return

Re: [PATCH 13/20] btrfs-progs: use cmd_struct as command entry point

2018-03-11 Thread Jeff Mahoney
On 3/7/18 9:40 PM, je...@suse.com wrote: > diff --git a/cmds-filesystem.c b/cmds-filesystem.c > index 62112705..ec038f2f 100644 > --- a/cmds-filesystem.c > +++ b/cmds-filesystem.c > @@ -1075,6 +1078,7 @@ next: > > return !!defrag_global_errors; > } > +static DEFINE_SIMPLE_COMMAND(filesyste

[PATCH] btrfs-progs: check: Fix false alerts on sector sized compressed inline file extent

2018-03-11 Thread Qu Wenruo
Commit 9d015c984006 ("btrfs-progs: Limit inline extent below page size") tries to fix the convert problem which we could create large inline file extent but kernel can't hanle. This leads the false alert about fsck test case 020. And after discussion about the problem in the mail list, we still n

Re: Raid1 volume stuck as read-only: How to dump, recreate and restore its content?

2018-03-11 Thread Duncan
Adam Borowski posted on Sun, 11 Mar 2018 18:47:13 +0100 as excerpted: > On Sun, Mar 11, 2018 at 11:28:08PM +0700, Andreas Hild wrote: >> Following a physical disk failure of a RAID1 array, I tried to mount >> the remaining volume of a root partition with "-o degraded". For some >> reason it ended