Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Tomasz Pala
On Fri, May 18, 2018 at 13:10:02 -0400, Austin S. Hemmelgarn wrote: > Personally though, I think the biggest issue with what was done was not > the memory consumption, but the fact that there was no switch to turn it > on or off. Making defrag unconditionally snapshot aware removes one of > th

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Omar Sandoval
On Fri, May 18, 2018 at 04:26:16PM -0600, Chris Murphy wrote: > On Fri, May 18, 2018 at 12:33 PM, Austin S. Hemmelgarn > wrote: > > On 2018-05-18 13:18, Niccolò Belli wrote: > >> > >> On venerdì 18 maggio 2018 19:10:02 CEST, Austin S. Hemmelgarn wrote: > >>> > >>> and also forces the people who ha

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Chris Murphy
On Fri, May 18, 2018 at 12:33 PM, Austin S. Hemmelgarn wrote: > On 2018-05-18 13:18, Niccolò Belli wrote: >> >> On venerdì 18 maggio 2018 19:10:02 CEST, Austin S. Hemmelgarn wrote: >>> >>> and also forces the people who have ridiculous numbers of snapshots to >>> deal with the memory usage or neve

Re: [PATCH v2 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-18 Thread Mark Fasheh
On Fri, May 18, 2018 at 03:04:13PM -0700, Darrick J. Wong wrote: > On Fri, May 18, 2018 at 02:57:27PM -0700, Mark Fasheh wrote: > > Right now we return EINVAL if a process does not have permission to dedupe a > > file. This was an oversight on my part. EPERM gives a true description of > > the natu

Re: [PATCH v2 1/2] vfs: allow dedupe of user owned read-only files

2018-05-18 Thread Mark Fasheh
On Fri, May 18, 2018 at 03:03:38PM -0700, Darrick J. Wong wrote: > > +/* Check whether we are allowed to dedupe the destination file */ > > +static int allow_file_dedupe(struct file *file) > > Shouldn't this return bool? It's a predicate, after all... Yeah that should be bool. Thanks for pointin

Re: [PATCH v2 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-18 Thread Darrick J. Wong
On Fri, May 18, 2018 at 02:57:27PM -0700, Mark Fasheh wrote: > Right now we return EINVAL if a process does not have permission to dedupe a > file. This was an oversight on my part. EPERM gives a true description of > the nature of our error, and EINVAL is already used for the case that the > files

Re: [PATCH v2 1/2] vfs: allow dedupe of user owned read-only files

2018-05-18 Thread Darrick J. Wong
On Fri, May 18, 2018 at 02:57:26PM -0700, Mark Fasheh wrote: > The permission check in vfs_dedupe_file_range() is too coarse - We > only allow dedupe of the destination file if the user is root, or > they have the file open for write. > > This effectively limits a non-root user from deduping their

[PATCH v2 0/2] vfs: better dedupe permission check

2018-05-18 Thread Mark Fasheh
Hi, The following patches fix a couple of issues with the permission check we do in vfs_dedupe_file_range(). The first patch expands our check to allow dedupe of a file if the user owns it or otherwise would be allowed to write to it. Current behavior is that we'll allow dedupe only if: - the u

[PATCH v2 1/2] vfs: allow dedupe of user owned read-only files

2018-05-18 Thread Mark Fasheh
The permission check in vfs_dedupe_file_range() is too coarse - We only allow dedupe of the destination file if the user is root, or they have the file open for write. This effectively limits a non-root user from deduping their own read-only files. In addition, the write file descriptor that the u

[PATCH v2 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-18 Thread Mark Fasheh
Right now we return EINVAL if a process does not have permission to dedupe a file. This was an oversight on my part. EPERM gives a true description of the nature of our error, and EINVAL is already used for the case that the filesystem does not support dedupe. Signed-off-by: Mark Fasheh --- fs/r

Re: [PATCH] Btrfs: fix error handling in btrfs_truncate()

2018-05-18 Thread Omar Sandoval
On Fri, May 18, 2018 at 02:43:02PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Jun Wu at Facebook reported that an internal service was seeing a return > value of 1 from ftruncate() on Btrfs when compression is enabled. This > is coming from the NEED_TRUNCATE_BLOCK return value from > b

[PATCH] Btrfs: fix error handling in btrfs_truncate()

2018-05-18 Thread Omar Sandoval
From: Omar Sandoval Jun Wu at Facebook reported that an internal service was seeing a return value of 1 from ftruncate() on Btrfs when compression is enabled. This is coming from the NEED_TRUNCATE_BLOCK return value from btrfs_truncate_inode_items(). btrfs_truncate() uses two variables for error

Re: [PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Andreas Dilger
On May 18, 2018, at 1:10 PM, Kent Overstreet wrote: > > On Fri, May 18, 2018 at 01:05:20PM -0600, Andreas Dilger wrote: >> On May 18, 2018, at 1:49 AM, Kent Overstreet >> wrote: >>> >>> Signed-off-by: Kent Overstreet >> >> I agree with Christoph that even if there was some explanation in the

Re: [PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:05:20PM -0600, Andreas Dilger wrote: > On May 18, 2018, at 1:49 AM, Kent Overstreet > wrote: > > > > Signed-off-by: Kent Overstreet > > I agree with Christoph that even if there was some explanation in the cover > letter, there should be something at least as good in

Re: [PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Andreas Dilger
On May 18, 2018, at 1:49 AM, Kent Overstreet wrote: > > Signed-off-by: Kent Overstreet I agree with Christoph that even if there was some explanation in the cover letter, there should be something at least as good in the patch itself. The cover letter is not saved, but the commit stays around

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Austin S. Hemmelgarn
On 2018-05-18 13:18, Niccolò Belli wrote: On venerdì 18 maggio 2018 19:10:02 CEST, Austin S. Hemmelgarn wrote: and also forces the people who have ridiculous numbers of snapshots to deal with the memory usage or never defrag Whoever has at least one snapshot is never going to defrag anyway, u

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 02:03:25PM -0400, Josef Bacik wrote: > There's nothing stopping us from doing that, it just uses a kprobe to override > the function with our helper, so we could conceivably put it anywhere in the > function. The reason I limited it to individual functions was because it wa

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Josef Bacik
On Fri, May 18, 2018 at 01:49:12PM -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 01:45:36PM -0400, Josef Bacik wrote: > > On Fri, May 18, 2018 at 03:48:58AM -0400, Kent Overstreet wrote: > > > These are all the remaining patches in my bcachefs tree that touch stuff > > > outside > > > fs

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:45:36PM -0400, Josef Bacik wrote: > On Fri, May 18, 2018 at 03:48:58AM -0400, Kent Overstreet wrote: > > These are all the remaining patches in my bcachefs tree that touch stuff > > outside > > fs/bcachefs. Not all of them are suitable for inclusion as is, I wanted to >

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Josef Bacik
On Fri, May 18, 2018 at 03:48:58AM -0400, Kent Overstreet wrote: > These are all the remaining patches in my bcachefs tree that touch stuff > outside > fs/bcachefs. Not all of them are suitable for inclusion as is, I wanted to get > some discussion first. > > * pagecache add lock > > This is th

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 08:53:30AM -0700, Christoph Hellwig wrote: > On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > > Historically, the only problematic case has been direct IO, and people > > > have been willing to say "well, if you mix buffered and direct IO you > > > get wha

Re: [PATCH 06/10] Generic radix trees

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 09:02:03AM -0700, Christoph Hellwig wrote: > Completely lacks any explanation, including why this should be > in lib/. Also should come in the same series with actual users > of the infrastructure. Also in the cover letter... * Generic radix trees This is a very simple

Re: [PATCH v4 00/12] Btrfs: orphan and truncate fixes

2018-05-18 Thread Omar Sandoval
On Fri, May 18, 2018 at 05:14:35PM +0200, David Sterba wrote: > On Fri, May 11, 2018 at 01:13:28PM -0700, Omar Sandoval wrote: > > This is the fourth (and hopefully final) version of the orphan item > > early ENOSPC and related fixes. > > > > Changes since v3: > > > > - Changed another stale comm

Re: [PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 09:02:45AM -0700, Christoph Hellwig wrote: > On Fri, May 18, 2018 at 03:49:18AM -0400, Kent Overstreet wrote: > > Signed-off-by: Kent Overstreet > > Completely lacks any explanation or argument why it would be useful. It's in the cover letter... * Dynamic fault injecti

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Niccolò Belli
On venerdì 18 maggio 2018 19:10:02 CEST, Austin S. Hemmelgarn wrote: and also forces the people who have ridiculous numbers of snapshots to deal with the memory usage or never defrag Whoever has at least one snapshot is never going to defrag anyway, unless he is willing to double the used spac

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Austin S. Hemmelgarn
On 2018-05-18 12:36, Niccolò Belli wrote: On venerdì 18 maggio 2018 18:20:51 CEST, David Sterba wrote: Josef started working on that in 2014 and did not finish it. The patches can be still found in his tree. The problem is in excessive memory consumption when there are many snapshots that need t

Re: [PATCH] btrfs: fix describe_relocation string pointer

2018-05-18 Thread David Sterba
On Thu, May 17, 2018 at 09:25:12PM +0800, Anand Jain wrote: > Looks like the original idea was to print the hex of the flags which > is not coded with their flag name. So use the current buf pointer bp > instead of buf. > > Signed-off-by: Anand Jain > --- > fs/btrfs/relocation.c | 2 +- > 1 file

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread Niccolò Belli
On venerdì 18 maggio 2018 18:20:51 CEST, David Sterba wrote: Josef started working on that in 2014 and did not finish it. The patches can be still found in his tree. The problem is in excessive memory consumption when there are many snapshots that need to be tracked during the defragmentation, so

Re: Any chance to get snapshot-aware defragmentation?

2018-05-18 Thread David Sterba
On Fri, May 11, 2018 at 05:22:26PM +0200, Niccolò Belli wrote: > I'm waiting for this feature since years and initially it seemed like > something which would have been worked on, sooner or later. > A long time had passed without any progress on this, so I would like to > know if there is any tec

Re: [PATCH 08/10] bcache: move closures to lib/

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 03:49:13AM -0400, Kent Overstreet wrote: > Prep work for bcachefs - being a fork of bcache it also uses closures Hell no. This code needs to go away and not actually be promoted to lib/. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body

Re: [PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 03:49:18AM -0400, Kent Overstreet wrote: > Signed-off-by: Kent Overstreet Completely lacks any explanation or argument why it would be useful. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org Mo

Re: [PATCH v2 2/6] Btrfs: use more straightforward extent_buffer_uptodate

2018-05-18 Thread David Sterba
On Fri, May 18, 2018 at 01:17:16PM +0800, Qu Wenruo wrote: > > > On 2018年05月18日 11:00, Liu Bo wrote: > > If parent_transid "0" is passed to btrfs_buffer_uptodate(), > > btrfs_buffer_uptodate() is equivalent to extent_buffer_uptodate(), but > > extent_buffer_uptodate() is preferred since we don't

Re: [PATCH 05/10] don't use spin_lock_irqsave() unnecessarily

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 03:49:08AM -0400, Kent Overstreet wrote: > Signed-off-by: Kent Overstreet Looks generally fine. A little changelog with an explanation of how we obviously never could get here with irqs disabled would be nice, though. -- To unsubscribe from this list: send the line "unsub

Re: [PATCH 06/10] Generic radix trees

2018-05-18 Thread Christoph Hellwig
Completely lacks any explanation, including why this should be in lib/. Also should come in the same series with actual users of the infrastructure. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info a

Re: [PATCH 02/10] mm: export find_get_pages()

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 03:49:02AM -0400, Kent Overstreet wrote: > Signed-off-by: Kent Overstreet > --- > mm/filemap.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/filemap.c b/mm/filemap.c > index 31dd888785..78b99019bf 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1845,6

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > Historically, the only problematic case has been direct IO, and people > > have been willing to say "well, if you mix buffered and direct IO you > > get what you deserve", and that's probably not unreasonable. But now we > > have f

Re: [PATCH V3 0/3] Btrfs: btrfs_dedupe_file_range() ioctl, remove 16MiB restriction

2018-05-18 Thread David Sterba
On Fri, May 11, 2018 at 05:22:58PM +0200, David Sterba wrote: > On Wed, May 02, 2018 at 08:15:35AM +0300, Timofey Titovets wrote: > > At now btrfs_dedupe_file_range() restricted to 16MiB range for > > limit locking time and memory requirement for dedup ioctl() > > > > For too big input range code

Re: [PATCH v4 00/12] Btrfs: orphan and truncate fixes

2018-05-18 Thread David Sterba
On Fri, May 11, 2018 at 01:13:28PM -0700, Omar Sandoval wrote: > This is the fourth (and hopefully final) version of the orphan item > early ENOSPC and related fixes. > > Changes since v3: > > - Changed another stale comment in patch 1 > - Moved BTRFS_INODE_ORPHAN_META_RESERVED flag removal to pa

Re: [PATCH v2 5/5] generic: test invalid swap file activation

2018-05-18 Thread Darrick J. Wong
On Wed, May 16, 2018 at 01:38:49PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Swap files cannot have holes, and they must at least two pages. > swapon(8) and mkswap(8) have stricter restrictions, so add versions of > those commands without any restrictions. > > Signed-off-by: Omar San

Re: [PATCH] Btrfs: fix the corruption by reading stale btree blocks

2018-05-18 Thread Nikolay Borisov
On 18.05.2018 17:06, David Sterba wrote: > On Fri, May 18, 2018 at 09:15:16PM +0800, Liu Bo wrote: Doesn't this warrant a stable tag and Fixes: 5bdd3536cbbe ("Btrfs: Fix block generation verification race") >>> >>> The patch will not apply to < 4.16 as it depends on the addition of >>>

Re: [PATCH] Btrfs: fix the corruption by reading stale btree blocks

2018-05-18 Thread David Sterba
On Fri, May 18, 2018 at 09:15:16PM +0800, Liu Bo wrote: > > > Doesn't this warrant a stable tag and > > > Fixes: 5bdd3536cbbe ("Btrfs: Fix block generation verification race") > > > > The patch will not apply to < 4.16 as it depends on the addition of > > &first_key check from 581c1760415c4, but y

Re: [PATCH] Btrfs: fix the corruption by reading stale btree blocks

2018-05-18 Thread Liu Bo
On Wed, May 16, 2018 at 04:12:21PM +0200, David Sterba wrote: > On Wed, May 16, 2018 at 11:00:14AM +0300, Nikolay Borisov wrote: > > > > > > On 15.05.2018 20:37, Liu Bo wrote: > > > If a btree block, aka. extent buffer, is not available in the extent > > > buffer cache, it'll be read out from the

Re: [PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Matthew Wilcox
On Fri, May 18, 2018 at 03:49:00AM -0400, Kent Overstreet wrote: > Add a per address space lock around adding pages to the pagecache - making it > possible for fallocate INSERT_RANGE/COLLAPSE_RANGE to work correctly, and also > hopefully making truncate and dio a bit saner. (moving this section he

[PATCH] btrfs: Document __btrfs_inc_extent_ref

2018-05-18 Thread Nikolay Borisov
Here is a doc-only patch which tires to deobfuscate the terra-incognita that arguments for delayed refs are. Signed-off-by: Nikolay Borisov --- Hello, This patch needs revieweing since I'm not entirely sure I managed to capture the semantics of the "parent" and "owner" arguments. Specifically,

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:40:54PM +0200, Peter Zijlstra wrote: > On Fri, May 18, 2018 at 07:32:05AM -0400, Kent Overstreet wrote: > > It does strike me that the whole optimistic spin algorithm > > (mutex_optimistic_spin() and rwsem_optimistic_spin()) are ripe for factoring > > out. They've been gr

Re: [PATCH v2 0/3] btrfs: add read mirror policy

2018-05-18 Thread Austin S. Hemmelgarn
On 2018-05-18 04:06, Anand Jain wrote: Thanks Austin and Jeff for the suggestion. I am not particularly a fan of mount option either mainly because those options aren't persistent and host independent luns will have tough time to have them synchronize manually. Properties are better as it is

RE: [PATCH v6 3/3] btrfs: Add unprivileged version of ino_lookup ioctl

2018-05-18 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono > Sent: Friday, May 18, 2018 10:55 AM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH v6 3/3] btrfs: Add unprivileged version of ino_lookup ioctl >

RE: [PATCH v6 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF

2018-05-18 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono > Sent: Friday, May 18, 2018 10:55 AM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH v6 2/3] btrfs: Add unprivileged ioctl which returns > subvol

RE: [PATCH v6 1/3] btrfs: Add unprivileged ioctl which returns subvolume information

2018-05-18 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono > Sent: Friday, May 18, 2018 10:55 AM > To: linux-btrfs@vger.kernel.org > Subject: [PATCH v6 1/3] btrfs: Add unprivileged ioctl which returns subvolume

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Peter Zijlstra
On Fri, May 18, 2018 at 07:32:05AM -0400, Kent Overstreet wrote: > It does strike me that the whole optimistic spin algorithm > (mutex_optimistic_spin() and rwsem_optimistic_spin()) are ripe for factoring > out. They've been growing more optimizations I see, and the optimizations > mostly > aren't

Re: [PATCH 03/10] locking: bring back lglocks

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:03:39PM +0200, Peter Zijlstra wrote: > On Fri, May 18, 2018 at 06:13:53AM -0400, Kent Overstreet wrote: > > On Fri, May 18, 2018 at 11:51:02AM +0200, Peter Zijlstra wrote: > > > On Fri, May 18, 2018 at 03:49:04AM -0400, Kent Overstreet wrote: > > > > bcachefs makes use of

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 01:08:08PM +0200, Peter Zijlstra wrote: > On Fri, May 18, 2018 at 06:18:04AM -0400, Kent Overstreet wrote: > > On Fri, May 18, 2018 at 11:52:04AM +0200, Peter Zijlstra wrote: > > > On Fri, May 18, 2018 at 03:49:06AM -0400, Kent Overstreet wrote: > > > > > > No.. and most ce

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Peter Zijlstra
On Fri, May 18, 2018 at 06:18:04AM -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 11:52:04AM +0200, Peter Zijlstra wrote: > > On Fri, May 18, 2018 at 03:49:06AM -0400, Kent Overstreet wrote: > > > > No.. and most certainly not without a _very_ good reason. > > Ok, can I ask why? Because

Re: [PATCH 03/10] locking: bring back lglocks

2018-05-18 Thread Peter Zijlstra
On Fri, May 18, 2018 at 06:13:53AM -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 11:51:02AM +0200, Peter Zijlstra wrote: > > On Fri, May 18, 2018 at 03:49:04AM -0400, Kent Overstreet wrote: > > > bcachefs makes use of them - also, add a proper lg_lock_init() > > > > Why?! lglocks are hor

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 11:52:04AM +0200, Peter Zijlstra wrote: > On Fri, May 18, 2018 at 03:49:06AM -0400, Kent Overstreet wrote: > > No.. and most certainly not without a _very_ good reason. Ok, can I ask why? Here's what it's for: commit 61782bf71eef83919af100a9747d8d86dfdf3605 Author: Kent

Re: [PATCH 03/10] locking: bring back lglocks

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 11:51:02AM +0200, Peter Zijlstra wrote: > On Fri, May 18, 2018 at 03:49:04AM -0400, Kent Overstreet wrote: > > bcachefs makes use of them - also, add a proper lg_lock_init() > > Why?! lglocks are horrid things, we got rid of them for a reason. They > have terrifying worst c

[PATCH] btrfs-progs: Add DEBUG_CFLAGS_INTERNAL for libbtrfsutil

2018-05-18 Thread Gu Jinxiang
From: Gu JinXiang Add DEBUG_CFLAGS_INTERNAL to LIBBTRFSUTIL_CFLAGS for libbtrfsutil's build. Signed-off-by: Gu JinXiang --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index cbd85533..1e38a56f 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,7 @@ LIBBTRFSU

Re: off-by-one uncompressed invalid ram_bytes corruptions

2018-05-18 Thread Qu Wenruo
On 2018年05月18日 17:42, james harvey wrote: > On Fri, May 18, 2018 at 1:49 AM, Qu Wenruo wrote: >> And btrfs check doesn't report the same problem as the default original >> mode doesn't have such check. >> >> Please also post the result of "btrfs check --mode=lowmem /dev/sda1" > > Are you saying

Re: [PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Peter Zijlstra
On Fri, May 18, 2018 at 03:49:06AM -0400, Kent Overstreet wrote: No.. and most certainly not without a _very_ good reason. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/

Re: [PATCH 03/10] locking: bring back lglocks

2018-05-18 Thread Peter Zijlstra
On Fri, May 18, 2018 at 03:49:04AM -0400, Kent Overstreet wrote: > bcachefs makes use of them - also, add a proper lg_lock_init() Why?! lglocks are horrid things, we got rid of them for a reason. They have terrifying worst case preemption off latencies. Why can't you use something like per-cpu rw

Re: off-by-one uncompressed invalid ram_bytes corruptions

2018-05-18 Thread james harvey
On Fri, May 18, 2018 at 1:49 AM, Qu Wenruo wrote: > And btrfs check doesn't report the same problem as the default original > mode doesn't have such check. > > Please also post the result of "btrfs check --mode=lowmem /dev/sda1" Are you saying "--mode=lowmem" does more checks than without it? "m

Re: btrfs device replace can cause silent or noisy corruption on compressed NOCOW/NODATASUM

2018-05-18 Thread james harvey
On Thu, May 17, 2018 at 5:46 AM, james harvey wrote: > ... > I of course don't know the extent of this. I don't know all of the > situations where NOCOW/NODATASUM extents are compressed anyway. In my > real world case, it was journald logs. We know journald/systemd > submits those for defragmen

Re: btrfs device replace can cause silent or noisy corruption on compressed NOCOW/NODATASUM

2018-05-18 Thread james harvey
On Thu, May 17, 2018 at 5:46 AM, james harvey wrote: > ... > In short, "btrfs device replace" caused it... > ... This should read "btrfs replace". Ran a 2 year old ISO, archlinux-2016.04.01-dual.iso. Kernel 4.4.5, btrfs-progs v4.4.1. Same behavior as example, so not a (within 2 year) regressio

Re: [PATCH v2 0/3] btrfs: add read mirror policy

2018-05-18 Thread Anand Jain
Thanks Austin and Jeff for the suggestion. I am not particularly a fan of mount option either mainly because those options aren't persistent and host independent luns will have tough time to have them synchronize manually. Properties are better as it is persistent. And we can apply this read_m

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Kent Overstreet
shit, git send-email pebkac error - disregard all the block patches in the thread -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Kent Overstreet
These are all the remaining patches in my bcachefs tree that touch stuff outside fs/bcachefs. Not all of them are suitable for inclusion as is, I wanted to get some discussion first. * pagecache add lock This is the only one that touches existing code in nontrivial ways. The problem it's solvin

[PATCH 01/10] mm: pagecache add lock

2018-05-18 Thread Kent Overstreet
Add a per address space lock around adding pages to the pagecache - making it possible for fallocate INSERT_RANGE/COLLAPSE_RANGE to work correctly, and also hopefully making truncate and dio a bit saner. Signed-off-by: Kent Overstreet --- fs/inode.c| 1 + include/linux/fs.h| 23

[PATCH 02/10] mm: export find_get_pages()

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- mm/filemap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/filemap.c b/mm/filemap.c index 31dd888785..78b99019bf 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1845,6 +1845,7 @@ unsigned find_get_pages_range(struct address_space *mapping, pgoff_t *st

[PATCH 03/10] locking: bring back lglocks

2018-05-18 Thread Kent Overstreet
bcachefs makes use of them - also, add a proper lg_lock_init() Signed-off-by: Kent Overstreet --- include/linux/lglock.h | 97 + kernel/locking/Makefile | 1 + kernel/locking/lglock.c | 105 3 files changed, 203 ins

[PATCH 04/10] locking: export osq_lock()/osq_unlock()

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- kernel/locking/osq_lock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c index 6ef600aa0f..dfa71347b0 100644 --- a/kernel/locking/osq_lock.c +++ b/kernel/locking/osq_lock.c @@ -202,6 +202,7 @@ bool osq

[PATCH 05/10] don't use spin_lock_irqsave() unnecessarily

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- mm/page-writeback.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 586f31261c..17ccc294c9 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2460,20 +2460,19 @@ int __set_page_

[PATCH 06/10] Generic radix trees

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- include/linux/generic-radix-tree.h | 131 ++ lib/Makefile | 3 +- lib/generic-radix-tree.c | 167 + 3 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 include/li

[PATCH 07/10] bcache: optimize continue_at_nobarrier()

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- drivers/md/bcache/closure.h | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h index 3b9dfc9962..2392a46bcd 100644 --- a/drivers/md/bcache/closure.h +++ b/drivers/md/bcache/cl

[PATCH 08/10] bcache: move closures to lib/

2018-05-18 Thread Kent Overstreet
Prep work for bcachefs - being a fork of bcache it also uses closures Signed-off-by: Kent Overstreet --- drivers/md/bcache/Kconfig | 10 +- drivers/md/bcache/Makefile | 6 +++--- drivers/md/bcache/bcache.h | 2 +- drivers/md/

[PATCH 09/10] closures: closure_wait_event()

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- include/linux/closure.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/linux/closure.h b/include/linux/closure.h index 1072bf2c13..ef22d18f7c 100644 --- a/include/linux/closure.h +++ b/include/linux/closure.h @@ -375,4 +375,2

[PATCH 10/10] Dynamic fault injection

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet --- include/asm-generic/vmlinux.lds.h | 4 + include/linux/dynamic_fault.h | 117 + lib/Kconfig.debug | 5 + lib/Makefile | 2 + lib/dynamic_fault.c | 760 ++ 5 files change