Re: [PATCH] btrfs-progs: fix find_mount_root() to handle duplicated mount point correctly

2014-09-14 Thread Omar Sandoval
Reviewed-by: Omar Sandoval osan...@osandov.com -- Omar -- 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

Re: [PATCH] btrfs-progs: fix find_mount_root() to handle duplicated mount point correctly

2014-09-17 Thread Omar Sandoval
What's the status on this patch? There have been at least a couple of bug reports that this fixes, including https://bugzilla.kernel.org/show_bug.cgi?id=83741. -- Omar -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org

[PATCH] Move BTRFS RCU string to common library

2014-09-18 Thread Omar Sandoval
The RCU-friendy string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Signed-off-by: Omar Sandoval osan...@osandov.com --- This patch applies to 3.17-rc5. fs/btrfs/check

[PATCH v2 0/2] Move BTRFS RCU string to common library

2014-09-19 Thread Omar Sandoval
on the return value from printk. The second patch actually moves the RCU string library. Version 2 passes on the return values from printk{,_ratelimited} and fixes some style issues. Omar Sandoval (2): Return a value from printk_ratelimited Move BTRFS RCU string to common library fs/btrfs

[PATCH v2 2/2] Move BTRFS RCU string to common library

2014-09-19 Thread Omar Sandoval
The RCU-friendy string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/check-integrity.c | 6 +-- fs/btrfs/dev

[PATCH v2 1/2] Return a value from printk_ratelimited

2014-09-19 Thread Omar Sandoval
printk returns an integer; there's no reason for printk_ratelimited to swallow it. Signed-off-by: Omar Sandoval osan...@osandov.com --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index d78125f

[PATCH v3 0/2] Move BTRFS RCU string to common library

2014-09-26 Thread Omar Sandoval
string header and updates the BTRFS code that depends on it. Version 3 adds the __rcu annotation to the relevant functions. Version 3 also adds Paul's ack and Josh's review. Omar Sandoval (2): Return a value from printk_ratelimited Move BTRFS RCU string to common library fs/btrfs/check

[PATCH v3 1/2] Return a value from printk_ratelimited

2014-09-26 Thread Omar Sandoval
printk returns an integer; there's no reason for printk_ratelimited to swallow it. Signed-off-by: Omar Sandoval osan...@osandov.com Acked-by: Paul E. McKenney paul...@linux.vnet.ibm.com --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include

Re: [PATCH v3 0/2] Move BTRFS RCU string to common library

2014-09-26 Thread Omar Sandoval
On Fri, Sep 26, 2014 at 10:36:47PM -0700, Omar Sandoval wrote: This patch series makes the generic RCU string library used internally by BTRFS accessible by anyone. The first patch makes printk_ratelimited pass on the return value from printk. Version 3 gives the temporary return variable

Re: [PATCH v3 1/2] Return a value from printk_ratelimited

2014-09-27 Thread Omar Sandoval
On Fri, Sep 26, 2014 at 10:48:11PM -0700, Joe Perches wrote: I'd prefer to keep it the way it is actually. I've submitted several patches to convert the int return to void for printk derived functions recently. Alright, it doesn't seem like anyone feels strongly for keeping the return

[PATCH] Move BTRFS RCU string to common library

2014-09-27 Thread Omar Sandoval
The RCU-friendly string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Signed-off-by: Omar Sandoval osan...@osandov.com Reviewed-by: Josh Triplett j...@joshtriplett.org Acked

[PATCH 2/2] btrfs: fix sparse lock context warnings

2014-09-28 Thread Omar Sandoval
Fix several sparse warnings that can easily be addressed with context annotations. These annotations also provide some sort of documentation for the internal helper functions. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ctree.c| 3 ++- fs/btrfs/extent-tree.c

[PATCH 1/2] btrfs: fix sparse address space warnings

2014-09-28 Thread Omar Sandoval
The buffer passed to vfs_write in send and several casts of ioctl fields are missing the __user annotation. Also fixes a couple of related trivial style issues. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 6 +++--- fs/btrfs/send.c | 8 2 files changed, 7

Re: [PATCH 0/2] btrfs: fix several sparse warnings

2014-09-28 Thread Omar Sandoval
On Sun, Sep 28, 2014 at 01:48:10AM -0700, Omar Sandoval wrote: This patch series fixes some warnings reported by sparse when building the btrfs module. It fixes two classes of warnings: address space warnings and lock context warnings. This didn't uncover any logical errors, but it reduces

Re: [PATCH 1/2] btrfs: fix sparse address space warnings

2014-09-28 Thread Omar Sandoval
On Sun, Sep 28, 2014 at 01:48:11AM -0700, Omar Sandoval wrote: diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 6528aa6..e0be577 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -515,7 +515,8 @@ static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off

[PATCH v2 3/3] btrfs: fix sparse lock context warnings

2014-09-30 Thread Omar Sandoval
Fix several sparse warnings that can easily be addressed with context annotations. These annotations also provide some sort of documentation for the internal helper functions. Signed-off-by: Omar Sandoval osan...@osandov.com Reviewed-by: David Sterba dste...@suse.cz --- fs/btrfs/extent-tree.c

[PATCH v2 1/3] btrfs: replace open-coded kernel_write

2014-09-30 Thread Omar Sandoval
write_buf used by btrfs send has what is more or less a reimplementation of kernel_write. This also gets rid of a sparse address space warning. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/send.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff

[PATCH v2 0/3] btrfs: fix several sparse warnings

2014-09-30 Thread Omar Sandoval
straightforward sparse warnings still remaining. Version 2 replaces an open-coded implementation of kernel_write in write_buf, doesn't touch unrelated style issues, and add's David's Reviewed-by. This patch series applies to 3.17-rc7. Omar Sandoval (3): btrfs: replace open-coded kernel_write btrfs: fix

Re: btrfs 3.16.2 does not recognize subvolumes correctly

2014-10-03 Thread Omar Sandoval
On Fri, Oct 03, 2014 at 12:40:33PM +0200, Jogi Hofmüller wrote: Hi all, First of all, I am talking about btrfs-progs 3.16.2 if there was any doubt. I did some more checking and found the following disturbing results. I can still create snapshots of subvolumes and the default subvolume

[PATCH v4 RESEND] Move BTRFS RCU string to common library

2014-10-03 Thread Omar Sandoval
The RCU-friendly string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Signed-off-by: Omar Sandoval osan...@osandov.com Reviewed-by: Josh Triplett j...@joshtriplett.org Acked

Re: [PATCH v4 RESEND] Move BTRFS RCU string to common library

2014-10-20 Thread Omar Sandoval
On Fri, Oct 03, 2014 at 10:12:38AM -0700, Omar Sandoval wrote: The RCU-friendly string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Signed-off-by: Omar Sandoval osan

Race condition in btrfs_releasepage?

2014-10-26 Thread Omar Sandoval
So I may be completely wrong here and someone might come in and tell me why this doesn't matter, but I'm just trying to understand the BTRFS code and I came across something that confused me. try_release_extent_mapping appears to access page-mapping-host-i_size without any sort of serialization.

[PATCH v5] Move BTRFS RCU string to common library

2014-11-07 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- Chris, could you take a look at this again? It's just been rebased and should be good to go. Thanks! v5: Rebase against v3.18-rc3 v4: Don't return anything from the printk wrappers on the assumption that printk will return void someday v3: Add __rcu

[PATCH v6] Move BTRFS RCU string to common library

2014-11-08 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- Chris, if you haven't pulled this in yet, Joe Perches pointed out that rcustring.h should include any headers it depends on. The following headers take care of it: #include linux/types.h #include linux/compiler.h #include linux/printk.h #include

Re: [PATCH v6] Move BTRFS RCU string to common library

2014-11-08 Thread Omar Sandoval
On Sat, Nov 08, 2014 at 08:13:37AM -0800, Joe Perches wrote: On Sat, 2014-11-08 at 00:46 -0800, Omar Sandoval wrote: The RCU-friendly string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code

[PATCH v7] Move BTRFS RCU string to common library

2014-11-13 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- Alright, here's one more go at it. v7: Add arguments to kernel doc for printk wrappers, use ##__VA_ARGS v6: Add header dependencies to rcustring.h v5: Rebase against v3.18-rc3 v4: Don't return anything from the printk wrappers on the assumption

[RFC PATCH 6/6] btrfs: enable swap file support

2014-11-17 Thread Omar Sandoval
Implement the swap file a_ops on btrfs. Activation simply checks for a usable swap file: it must be fully allocated (no holes), support direct I/O (so no compressed or inline extents) and should be nocow (I'm not sure about that last one). Signed-off-by: Omar Sandoval osan...@osandov.com --- fs

[RFC PATCH 5/6] btrfs: don't mark extents used for swap as up to date

2014-11-17 Thread Omar Sandoval
As pages in the swapcache get shuffled around and repurposed for different pages in the swap file, the EXTENT_UPTODATE flag doesn't apply. This leads to some really weird symptoms in userspace where pages in a process's address space appear to get mixed up. Signed-off-by: Omar Sandoval osan

[RFC PATCH 4/6] btrfs: don't check the cleancache for swapcache pages

2014-11-17 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/extent_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 54b2d00..b8dc256 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2904,13 +2904,14

[RFC PATCH 3/6] btrfs: don't set -private on swapcache pages

2014-11-17 Thread Omar Sandoval
Swapcache pages use -private to store the swp_entry_t; overwriting it is sure to cause insanity. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/extent_io.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index

[RFC PATCH 0/6] btrfs: implement swap file support

2014-11-17 Thread Omar Sandoval
on compressed or inline extents. - Supporting COW swapfiles might come with some weird edge cases? This is something that is probably good for discussion. This functionality is tenuously tested in a virtual machine with some artificial workloads. I'd really appreciate any comments. Omar Sandoval (6

[RFC PATCH 2/6] btrfs: don't allow -C or +c chattrs on a swap file

2014-11-17 Thread Omar Sandoval
swap_activate will check for a compressed or copy-on-write file; we shouldn't allow it to become either once it has already been activated. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 50 +++--- 1 file changed, 31 insertions

[RFC PATCH 1/6] btrfs: convert uses of -mapping and -index to wrappers

2014-11-17 Thread Omar Sandoval
/compression.c does some shuffling around of the -mapping field directly. We can't have a compressed swap file anyways, so I didn't touch that file. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/disk-io.c| 16 +++--- fs/btrfs/extent_io.c | 137

Re: [RFC PATCH 0/6] btrfs: implement swap file support

2014-11-18 Thread Omar Sandoval
e58c52e69a9aef07c0089f9ce552fca96d42bce9 Mon Sep 17 00:00:00 2001 Message-Id: e58c52e69a9aef07c0089f9ce552fca96d42bce9.1416380574.git.osan...@osandov.com From: Omar Sandoval osan...@osandov.com Date: Tue, 18 Nov 2014 22:42:10 -0800 Subject: [PATCH] swap: use direct_IO for swap_readpage Signed-off-by: Omar

Re: [PATCH v7] Move BTRFS RCU string to common library

2014-11-20 Thread Omar Sandoval
On Thu, Nov 13, 2014 at 02:18:21AM -0800, Omar Sandoval wrote: The RCU-friendly string API used internally by BTRFS is generic enough for common use. This doesn't add any new functionality, but instead just moves the code and documents the existing API. Reviewed-by: Josh Triplett j

[PATCH v2 2/5] nfs: don't dirty ITER_BVEC pages read through direct I/O

2014-11-21 Thread Omar Sandoval
As with the generic blockdev code, kernel pages shouldn't be dirtied by the direct I/O path. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/nfs/direct.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 10bf072..a67fa2c

[PATCH v2 5/5] btrfs: enable swap file support

2014-11-21 Thread Omar Sandoval
Implement the swap file a_ops on btrfs. Activation simply checks for a usable swap file: it must be fully allocated (no holes), support direct I/O (so no compressed or inline extents) and should be nocow (I'm not sure about that last one). Signed-off-by: Omar Sandoval osan...@osandov.com --- fs

[PATCH v2 1/5] direct-io: don't dirty ITER_BVEC pages on read

2014-11-21 Thread Omar Sandoval
Reads through the iov_iter infrastructure for kernel pages shouldn't be dirtied by the direct I/O code. This is based on Dave Kleikamp's and Ming Lei's previously posted patches. Cc: Dave Kleikamp dave.kleik...@oracle.com Cc: Ming Lei ming@canonical.com Signed-off-by: Omar Sandoval osan

Re: [RFC PATCH 0/6] btrfs: implement swap file support

2014-11-21 Thread Omar Sandoval
On Fri, Nov 21, 2014 at 02:06:57AM -0800, Christoph Hellwig wrote: On Tue, Nov 18, 2014 at 11:22:35PM -0800, Omar Sandoval wrote: Here's a nice little bit of insanity I put together in that direction -- consider it a discussion point more than a patch. It does two things: - Uses

[PATCH v2 4/5] btrfs: don't allow -C or +c chattrs on a swap file

2014-11-21 Thread Omar Sandoval
swap_activate will check for a compressed or copy-on-write file; we shouldn't allow it to become either once it has already been activated. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 50 +++--- 1 file changed, 31 insertions

[PATCH v2 3/5] swap: use direct I/O for SWP_FILE swap_readpage

2014-11-21 Thread Omar Sandoval
-by: Omar Sandoval osan...@osandov.com --- mm/page_io.c | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 955db8b..10715e0 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -283,8 +283,7 @@ int __swap_writepage(struct

[PATCH v2 0/5] btrfs: implement swap file support

2014-11-21 Thread Omar Sandoval
. - Supporting COW swapfiles might also come with some weird edge cases? This functionality is tenuously tested in a virtual machine with some artificial workloads. Comment away. Omar Sandoval (5): direct-io: don't dirty ITER_BVEC pages on read nfs: don't dirty ITER_BVEC pages read through direct I/O

Re: [PATCH v2 0/5] btrfs: implement swap file support

2014-11-21 Thread Omar Sandoval
Sorry for the noise, looks like Christoph got back to me on the previous RFC just before I sent this out -- disregard this for now. -- Omar -- 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

Re: [PATCH v2 5/5] btrfs: enable swap file support

2014-11-22 Thread Omar Sandoval
On Fri, Nov 21, 2014 at 07:00:45PM +0100, David Sterba wrote: + pr_err(BTRFS: swapfile has holes); + ret = -EINVAL; + goto out; + } + if (em-block_start == EXTENT_MAP_INLINE) { + pr_err(BTRFS:

Re: [PATCH v2 5/5] btrfs: enable swap file support

2014-11-24 Thread Omar Sandoval
On Sat, Nov 22, 2014 at 12:03:57PM -0800, Omar Sandoval wrote: On Fri, Nov 21, 2014 at 07:00:45PM +0100, David Sterba wrote: + ret = -EINVAL; + goto out; + } + if (test_bit(EXTENT_FLAG_COMPRESSED, em-flags)) { + pr_err

Re: [PATCH v2 0/5] btrfs: implement swap file support

2014-11-24 Thread Omar Sandoval
On Fri, Nov 21, 2014 at 02:19:14AM -0800, Christoph Hellwig wrote: On Fri, Nov 21, 2014 at 02:15:31AM -0800, Omar Sandoval wrote: Sorry for the noise, looks like Christoph got back to me on the previous RFC just before I sent this out -- disregard this for now. If the NFS people are fine

[PATCH 0/3] btrfs: fix RCU string sparse noise

2014-11-30 Thread Omar Sandoval
use of RCU in the BTRFS_IOC_DEV_INFO ioctl. The third refactors the volume code's usage of rcu_string, fixing a questionable RCU or two in the process. This patch series applies to Chris' integration branch. Thanks! Omar Sandoval (3): rcustring: clean up botched __rcu annotations btrfs: fix

[PATCH 3/3] btrfs: refactor btrfs_device-name updates

2014-11-30 Thread Omar Sandoval
on. This introduces some helper functions that factor out this functionality. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/volumes.c | 93 +- fs/btrfs/volumes.h | 2 +- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/fs/btrfs

[PATCH 2/3] btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

2014-11-30 Thread Omar Sandoval
A naked read of the value of an RCU pointer isn't safe. Put the whole access in an RCU critical section, not just the pointer dereference. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs

[PATCH 1/3] rcustring: clean up botched __rcu annotations

2014-11-30 Thread Omar Sandoval
The rcu_string returned by rcu_string_strdup isn't technically under RCU yet, and it makes more sense not to treat it as such. Additionally, an rcu_string passed to rcu_string_free should already be rcu_dereferenced and therefore not in the __rcu address space. Signed-off-by: Omar Sandoval osan

Re: [PATCH 3/3] btrfs: refactor btrfs_device-name updates

2014-11-30 Thread Omar Sandoval
On Sun, Nov 30, 2014 at 10:26:43AM -0500, Pranith Kumar wrote: On Sun, Nov 30, 2014 at 3:26 AM, Omar Sandoval osan...@osandov.com wrote: The rcu_string API introduced some new sparse errors but also revealed existing ones. First of all, the name in struct btrfs_device should be annotated

Re: [PATCH 2/3] btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

2014-11-30 Thread Omar Sandoval
On Sun, Nov 30, 2014 at 10:11:41AM -0500, Pranith Kumar wrote: On Sun, Nov 30, 2014 at 3:26 AM, Omar Sandoval osan...@osandov.com wrote: A naked read of the value of an RCU pointer isn't safe. Put the whole access in an RCU critical section, not just the pointer dereference. Signed-off

[PATCH v8 3/3] btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

2014-12-07 Thread Omar Sandoval
A naked read of the value of an RCU pointer isn't safe. Put the whole access in an RCU critical section, not just the pointer dereference. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs

[PATCH v8 0/3] Introduce RCU string API

2014-12-07 Thread Omar Sandoval
v5: Rebase against v3.18-rc3 v4: Don't return anything from the printk wrappers on the assumption that printk will return void someday v3: Add __rcu annotation to relevant functions, add Paul's ack and Josh's review Omar Sandoval (3): Move BTRFS RCU string to common library btrfs: refactor

[PATCH v8 1/3] Move BTRFS RCU string to common library

2014-12-07 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/check-integrity.c | 6 +-- fs/btrfs/dev-replace.c | 19 - fs/btrfs/disk-io.c | 6 +-- fs/btrfs/extent_io.c | 4 +- fs/btrfs/ioctl.c | 4 +- fs/btrfs/raid56.c | 2 +- fs/btrfs/rcu-string.h

[PATCH v8 2/3] btrfs: refactor btrfs_device-name updates

2014-12-07 Thread Omar Sandoval
on. This introduces some helper functions that factor out this functionality. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/volumes.c | 93 +- fs/btrfs/volumes.h | 2 +- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/fs/btrfs

[RFC PATCH v3 7/7] btrfs: enable swap file support

2014-12-09 Thread Omar Sandoval
of allocations for a COW when we're already low on memory 2. Pins the extent maps in memory with EXTENT_FLAG_SWAPFILE Deactivation unpins all of the extent maps. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/inode.c | 131 +++ 1 file changed

[RFC PATCH v3 1/7] direct-io: don't dirty ITER_BVEC pages on read

2014-12-09 Thread Omar Sandoval
Reads through the iov_iter infrastructure for kernel pages shouldn't be dirtied by the direct I/O code. This is based on Dave Kleikamp's and Ming Lei's previously posted patches. Cc: Ming Lei ming@canonical.com Acked-by: Dave Kleikamp dave.kleik...@oracle.com Signed-off-by: Omar Sandoval

[RFC PATCH v3 6/7] btrfs: add EXTENT_FLAG_SWAPFILE

2014-12-09 Thread Omar Sandoval
Extents mapping a swap file should remain pinned in memory in order to avoid doing allocations to look up an extent when we're already low on memory. Rather than overloading EXTENT_FLAG_PINNED, add a new flag specifically for this purpose. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs

[RFC PATCH v3 4/7] vfs: update swap_{,de}activate documentation

2014-12-09 Thread Omar Sandoval
Parameters were added to swap_activate in the same patch series that introduced it without updating the documentation. Additionally, the documentation claims that non-existent address space operations swap_{in,out} are used for swap I/O, but it's (now) direct_IO. Signed-off-by: Omar Sandoval osan

[RFC PATCH v3 3/7] swap: use direct I/O for SWP_FILE swap_readpage

2014-12-09 Thread Omar Sandoval
-by: Omar Sandoval osan...@osandov.com --- mm/page_io.c | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 955db8b..10715e0 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -283,8 +283,7 @@ int __swap_writepage(struct

[RFC PATCH v3 5/7] btrfs: prevent ioctls from interfering with a swap file

2014-12-09 Thread Omar Sandoval
- dedup Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/disk-io.c | 1 + fs/btrfs/ioctl.c | 35 +++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index fe69edd..38979b9

[RFC PATCH v3 2/7] nfs: don't dirty ITER_BVEC pages read through direct I/O

2014-12-09 Thread Omar Sandoval
As with the generic blockdev code, kernel pages shouldn't be dirtied by the direct I/O path. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/nfs/direct.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 10bf072..a67fa2c

[RFC PATCH v3 0/7] btrfs: implement swap file support

2014-12-09 Thread Omar Sandoval
a surprising inconsistency for users (in my opinion). As with before, this functionality is tenuously tested in a virtual machine with some artificial workloads, but it works for me. I'm pretty happy with the results on my end, so please comment away. Thanks! Omar Sandoval (7): direct-io

Re: [RFC PATCH v3 7/7] btrfs: enable swap file support

2014-12-12 Thread Omar Sandoval
On Fri, Dec 12, 2014 at 11:51:22AM +0100, David Sterba wrote: On Tue, Dec 09, 2014 at 05:45:48PM -0800, Omar Sandoval wrote: +static void __clear_swapfile_extents(struct inode *inode) +{ + u64 isize = inode-i_size; + struct extent_map *em; + u64 start, len; + + start = 0

Re: [RFC PATCH v3 0/7] btrfs: implement swap file support

2014-12-12 Thread Omar Sandoval
On Fri, Dec 12, 2014 at 11:32:13AM +0100, David Sterba wrote: On Tue, Dec 09, 2014 at 05:45:41PM -0800, Omar Sandoval wrote: After some discussion on the mailing list, I decided that for simplicity and reliability, it's best to simply disallow COW files and files with shared extents (like

Re: Forever blocked in bit_wait with kernel 3.19

2015-02-17 Thread Omar Sandoval
On Thu, Feb 12, 2015 at 11:12:25AM +, Steven Schlansker wrote: [ Please CC me on replies, I'm not on the list ] [ This is a followup to http://www.spinics.net/lists/linux-btrfs/msg41496.html ] Hello linux-btrfs, I've been having troubles keeping my Apache Mesos / Docker slave nodes

Re: [PATCH 2/3] btrfs: handle race on ENOMEM in alloc_extent_buffer

2015-02-17 Thread Omar Sandoval
On Tue, Feb 17, 2015 at 02:51:08AM -0800, Omar Sandoval wrote: Consider the following interleaving of overlapping calls to alloc_extent_buffer: Call 1: - Successfully allocates a few pages with find_or_create_page - find_or_create_page fails, goto free_eb - Unlocks the allocated pages

[PATCH 3/3] btrfs: check io_ctl_prepare_pages return in __btrfs_write_out_cache

2015-02-17 Thread Omar Sandoval
If io_ctl_prepare_pages fails, the pages in io_ctl.pages are not valid. When we try to access them later, things will blow up in various ways. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/free-space-cache.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH 2/3] btrfs: handle race on ENOMEM in alloc_extent_buffer

2015-02-17 Thread Omar Sandoval
-private of the half-written extent_buffer's pages all at once while holding mapping-private_lock. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/extent_io.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs

[PATCH 1/3] btrfs: handle ENOMEM in btrfs_alloc_tree_block

2015-02-17 Thread Omar Sandoval
This is one of the first places to go when memory is tight. Handle it properly rather than with a BUG_ON. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/extent-tree.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/fs

[PATCH 0/3] btrfs: ENOMEM bugfixes

2015-02-17 Thread Omar Sandoval
cgexec -g memory:enomem python -c ' l = [] while True: l.append(0)' done Ignoring for now the cases that drop the filesystem into read-only mode with relatively little fuss, here are a few patches that fix some of the low-hanging fruit. They apply to Linus' tree as of today. Thanks! Omar

Re: [PATCH RESEND v8 0/3] Introduce RCU string API

2015-01-10 Thread Omar Sandoval
On Sat, Jan 10, 2015 at 11:56:48AM -0800, Paul E. McKenney wrote: On Fri, Jan 09, 2015 at 12:35:57PM -0800, Omar Sandoval wrote: Hi, everyone, Now that the merge window and the holidays are over, I've rebased this on v3.19-rc3 for the next merge window. Wasn't btrfs going to take

[PATCH RESEND v8 0/3] Introduce RCU string API

2015-01-09 Thread Omar Sandoval
and Josh's review Omar Sandoval (3): Move BTRFS RCU string to common library btrfs: refactor btrfs_device-name updates btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO fs/btrfs/check-integrity.c | 6 +-- fs/btrfs/dev-replace.c | 19 fs/btrfs/disk-io.c | 6 +-- fs/btrfs

[PATCH RESEND v8 2/3] btrfs: refactor btrfs_device-name updates

2015-01-09 Thread Omar Sandoval
on. This introduces some helper functions that factor out this functionality. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/volumes.c | 93 +- fs/btrfs/volumes.h | 2 +- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/fs/btrfs

[PATCH RESEND v8 1/3] Move BTRFS RCU string to common library

2015-01-09 Thread Omar Sandoval
Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/check-integrity.c | 6 +-- fs/btrfs/dev-replace.c | 19 - fs/btrfs/disk-io.c | 6 +-- fs/btrfs/extent_io.c | 4 +- fs/btrfs/ioctl.c | 4 +- fs/btrfs/raid56.c | 2 +- fs/btrfs/rcu-string.h

Re: [PATCH 0/3] btrfs: ENOMEM bugfixes

2015-02-20 Thread Omar Sandoval
On Tue, Feb 17, 2015 at 02:51:06AM -0800, Omar Sandoval wrote: Hi, As it turns out, running with low memory is a really easy way to shake out undesirable behavior in Btrfs. This can be especially bad when considering that a memory limit is really easy to hit in a container (e.g., by using

[RFC PATCH 0/5] Remove rw parameter from direct_IO()

2015-03-16 Thread Omar Sandoval
a good thing. They should apply on top of v4.0-rc4. Please comment away. Thank you, Omar Sandoval (5): new helper: iov_iter_rw() Remove rw from {,__,do_}blockdev_direct_IO() Remove rw from dax_{do_,}io() direct_IO: use iov_iter_rw() instead of rw everywhere direct_IO: remove rw from a_ops

[RFC PATCH 4/5] direct_IO: use iov_iter_rw() instead of rw everywhere

2015-03-16 Thread Omar Sandoval
either READ or WRITE. Signed-off-by: Omar Sandoval osan...@osandov.com --- drivers/staging/lustre/lustre/llite/rw26.c | 18 +- fs/affs/file.c | 4 ++-- fs/btrfs/inode.c | 12 ++-- fs/ext2/inode.c

[RFC PATCH 3/5] Remove rw from dax_{do_,}io()

2015-03-16 Thread Omar Sandoval
And use iov_iter_rw() instead. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/dax.c | 27 +-- fs/ext2/inode.c| 4 ++-- fs/ext4/indirect.c | 4 ++-- fs/ext4/inode.c| 2 +- include/linux/fs.h | 4 ++-- 5 files changed, 20 insertions(+), 21

[RFC PATCH 5/5] direct_IO: remove rw from a_ops-direct_IO()

2015-03-16 Thread Omar Sandoval
Now that no one is using rw, remove it completely. Signed-off-by: Omar Sandoval osan...@osandov.com --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 4 ++-- fs/9p/vfs_addr.c

[RFC PATCH 1/5] new helper: iov_iter_rw()

2015-03-16 Thread Omar Sandoval
Get either READ or WRITE out of iter-type. Signed-off-by: Omar Sandoval osan...@osandov.com --- include/linux/uio.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/uio.h b/include/linux/uio.h index 7188029..87a47b3 100644 --- a/include/linux/uio.h +++ b/include

Re: [RFC PATCH 1/5] new helper: iov_iter_rw()

2015-03-17 Thread Omar Sandoval
On Tue, Mar 17, 2015 at 10:31:51AM +0100, David Sterba wrote: On Mon, Mar 16, 2015 at 05:36:05PM +, Al Viro wrote: On Mon, Mar 16, 2015 at 04:33:49AM -0700, Omar Sandoval wrote: Get either READ or WRITE out of iter-type. Umm... + * Get one of READ or WRITE out of iter-type

[RFC PATCH 2/5] Remove rw from {,__,do_}blockdev_direct_IO()

2015-03-16 Thread Omar Sandoval
Most filesystems call through to these at some point, so we'll start here. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/affs/file.c | 2 +- fs/block_dev.c | 5 ++--- fs/btrfs/inode.c| 8 fs/direct-io.c | 39 ++- fs

Re: btrfs oops while mounting fuzzed btrfs image

2015-03-06 Thread Omar Sandoval
On Fri, Mar 06, 2015 at 09:56:07AM +0800, Qu Wenruo wrote: Original Message Subject: Re: btrfs oops while mounting fuzzed btrfs image From: Liu Bo bo.li@oracle.com To: Eryu Guan guane...@gmail.com Date: 2015年03月05日 18:27 On Thu, Mar 05, 2015 at 06:13:54PM +0800,

Re: [PATCH v2 0/3] btrfs: ENOMEM bugfixes

2015-03-13 Thread Omar Sandoval
On Fri, Mar 13, 2015 at 12:04:30PM +0100, David Sterba wrote: On Wed, Mar 11, 2015 at 09:40:17PM -0700, Omar Sandoval wrote: Ping. For anyone following along, it looks like commit cc87317726f8 (mm: page_alloc: revert inadvertent !__GFP_FS retry behavior change) reverted the commit

Re: [PATCH v2 0/3] btrfs: ENOMEM bugfixes

2015-03-11 Thread Omar Sandoval
On Tue, Feb 24, 2015 at 02:47:03AM -0800, Omar Sandoval wrote: Hi, everyone, This patch series fixes a few bugs that occur under low memory conditions. These were exposed by a change in behavior of GFP_NOFS allocations in 3.19-rc7, by commit 9879de7373fc (mm: page_alloc: embed OOM killing

[PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Omar Sandoval
-by: Timo Kokkonen timo.kokko...@offcode.fi Fixes: bafc9b754f75 (vfs: More precise tests in d_invalidate) Signed-off-by: Omar Sandoval osan...@osandov.com --- This applies to 4.0-rc6. To be honest, I'm not sure that this is the most correct fix for this bug, but it's equivalent to the pre-3.18 behavior

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Omar Sandoval
On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: Before commit bafc9b754f75 (vfs: More precise tests in d_invalidate), d_invalidate() could return -EBUSY when a dentry for a directory had more than one reference

Re: [PATCH] Btrfs: fix inode eviction infinite loop after cloning into it

2015-03-30 Thread Omar Sandoval
-by: Filipe Manana fdman...@suse.com Reviewed-by: Omar Sandoval osan...@osandov.com -- Omar -- 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

Re: [PATCH] Btrfs: fix inode eviction infinite loop after extent_same ioctl

2015-03-30 Thread Omar Sandoval
Signed-off-by: Filipe Manana fdman...@suse.com Reviewed-by: Omar Sandoval osan...@osandov.com Reproduced with https://github.com/markfasheh/duperemove/blob/master/btrfs-extent-same.c ./btrfs-extent-same 0 foo 4096 bar 4096 -- Omar -- To unsubscribe from this list: send the line unsubscribe linux

Re: Btrfs Send/Receive utime error And WARN_ON Cannot allocate memory

2015-03-30 Thread Omar Sandoval
On Tue, Mar 31, 2015 at 11:06:10AM +0800, Robbie Ko wrote: Hi, I have testing btrfs send/receive recently. I got an error send ioctl failed with -12: Cannot allocate memory on send side. WARN_ON happened on len PATH_MAX in fs_path_ensure_buf. I got an error utime failed: No such file

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Tue, Mar 31, 2015 at 10:54:55PM -0500, Eric W. Biederman wrote: Omar Sandoval osan...@osandov.com writes: On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: Before commit bafc9b754f75 (vfs: More precise tests

[PATCH] btrfs: unlock i_mutex after attempting to delete subvolume during send

2015-03-28 Thread Omar Sandoval
: (type-i_mutex_dir_key){+.+.+.}, at: [8135b8df] btrfs_ioctl_snap_destroy+0x2df/0x7a0 Make sure we unlock it in the error path. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Omar Sandoval
On Fri, Feb 27, 2015 at 09:01:10AM +0100, Michael Kerrisk (man-pages) wrote: On 02/27/2015 01:04 AM, Theodore Ts'o wrote: On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that in the case of a system

[PATCH v2 3/3] btrfs: check io_ctl_prepare_pages return in __btrfs_write_out_cache

2015-02-24 Thread Omar Sandoval
@oracle.com Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/free-space-cache.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index a719785..03dcda2 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs

[PATCH v2 1/3] btrfs: handle ENOMEM in btrfs_alloc_tree_block

2015-02-24 Thread Omar Sandoval
This is one of the first places to give out when memory is tight. Handle it properly rather than with a BUG_ON. Also fix the comment about the return value, which is an ERR_PTR, not NULL, on error. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/extent-tree.c | 41

[PATCH v2 0/3] btrfs: ENOMEM bugfixes

2015-02-24 Thread Omar Sandoval
rebases on top of 4.0-rc1, has a simpler fix for the alloc_extent_buffer race, expands the commit messages to mention changed comments, and adds Liu Bo's Reviewed-by. Thanks! Omar Sandoval (3): btrfs: handle ENOMEM in btrfs_alloc_tree_block btrfs: fix race on ENOMEM in alloc_extent_buffer

Re: [PATCH v2 0/3] btrfs: ENOMEM bugfixes

2015-03-27 Thread Omar Sandoval
On Fri, Mar 13, 2015 at 12:43:42PM -0700, Omar Sandoval wrote: On Fri, Mar 13, 2015 at 12:04:30PM +0100, David Sterba wrote: On Wed, Mar 11, 2015 at 09:40:17PM -0700, Omar Sandoval wrote: Ping. For anyone following along, it looks like commit cc87317726f8 (mm: page_alloc: revert

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Wed, Apr 01, 2015 at 01:22:42PM +0200, David Sterba wrote: On Wed, Apr 01, 2015 at 12:03:28AM -0700, Omar Sandoval wrote: --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1024,6 +1024,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) struct

  1   2   3   4   5   6   7   8   9   >