[PATCH] textsearch: clarify how to clean up in doc

2014-10-09 Thread Omar Sandoval
textsearch_put() doesn't exist; this comment appears to be referring to textsearch_destroy(). Signed-off-by: Omar Sandoval --- This patch applies to 3.17. There was a patch submitted previously which got rid of this documentation (https://lkml.org/lkml/2014/9/6/128), but this is a little

Re: [PATCH] net sched: text ematch: zero out ts_state before using it

2014-10-09 Thread Omar Sandoval
On Thu, Oct 09, 2014 at 02:48:54PM -0700, Cong Wang wrote: > On Thu, Oct 9, 2014 at 9:05 AM, Omar Sandoval wrote: > > textsearch_find zeroes out the offset, but the control buffer (which may or > > may > > not matter in this case) needs to be zeroed out as well. > >

Re: btrfs balance 4.0 regression?

2015-05-14 Thread Omar Sandoval
On Fri, May 15, 2015 at 12:15:06AM +, Duncan wrote: > Josh Boyer posted on Thu, 14 May 2015 08:43:25 -0400 as excerpted: > > > Hi Omar and Chris, > > > > We have a bug reported [1] against 4.0 saying that btrfs balance is > > broken. The reporter found a revert patch that Omar sent [2] to re

Re: btrfs balance 4.0 regression?

2015-05-17 Thread Omar Sandoval
On Thu, May 14, 2015 at 05:33:29PM -0700, Omar Sandoval wrote: > On Fri, May 15, 2015 at 12:15:06AM +, Duncan wrote: > > Josh Boyer posted on Thu, 14 May 2015 08:43:25 -0400 as excerpted: > > > > > Hi Omar and Chris, > > > > > > We have a bug

Re: suspend regression in 4.1-rc1

2015-05-17 Thread Omar Sandoval
On Sun, May 17, 2015 at 08:50:41PM +0200, Michal Hocko wrote: > Hi, > s2ram broke after 4.1-rc1 for me. The second s2ram simply doesn't wake > up (fans turn on but the screen is off). I have even noticed fans > starting also while suspended in some instances (which was especially > annoying when it

Re: [PATCH v2 0/6] Btrfs: show subvolume name and ID in /proc/mounts

2015-05-11 Thread Omar Sandoval
On Thu, Apr 09, 2015 at 02:34:50PM -0700, Omar Sandoval wrote: > Here's version 2 of providing the subvolume name and ID in /proc/mounts. > > It turns out that getting the name of a subvolume reliably is a bit > trickier than it would seem because of how mounting subvolumes by ID

Re: [PATCH v2 5/6] Btrfs: unify subvol= and subvolid= mounting

2015-05-11 Thread Omar Sandoval
On Mon, May 11, 2015 at 05:37:24PM +0200, David Sterba wrote: > On Thu, Apr 09, 2015 at 02:34:55PM -0700, Omar Sandoval wrote: > > @@ -1321,7 +1438,7 @@ static struct dentry *btrfs_mount(struct > > file_system_type *fs_type, int flags, > >

Re: [PATCH v2 0/6] Btrfs: show subvolume name and ID in /proc/mounts

2015-05-11 Thread Omar Sandoval
On Mon, May 11, 2015 at 04:51:37PM +0200, David Sterba wrote: > On Mon, May 11, 2015 at 02:42:58AM -0700, Omar Sandoval wrote: > > Sorry for the long-winded email! Thoughts, David, Qu? > > I'm ok with the approach and the patchset as a whole. There was one > minor issue w

[PATCH] sched/core: fix regression in cpuset_cpu_inactive for suspend

2015-05-04 Thread Omar Sandoval
_DOWN_PREPARE_FROZEN case of the switch statement in cpuset_cpu_inactive. However, the commit in question masked out CPU_TASKS_FROZEN from the action, making this case dead. The fix is straightforward. Fixes: 3c18d447b3b3 ("sched/core: Check for available DL bandwidth in cpuset_cpu_inact

Re: [PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-18 Thread Omar Sandoval
On Wed, Dec 17, 2014 at 10:03:13PM +, Al Viro wrote: > On Wed, Dec 17, 2014 at 10:52:56AM -0800, Christoph Hellwig wrote: > > On Wed, Dec 17, 2014 at 06:58:32AM -0800, Omar Sandoval wrote: > > > See my previous message. If we use O_DIRECT on the original open, then >

[PATCH] nfs: prevent truncate on active swapfile

2014-12-18 Thread Omar Sandoval
, and not doing so is dangerous. Signed-off-by: Omar Sandoval --- fs/nfs/inode.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 4bffe63..9205513 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -506,10 +506,15 @@ nfs_setattr(s

Re: [PATCH] nfs: prevent truncate on active swapfile

2014-12-18 Thread Omar Sandoval
On Thu, Dec 18, 2014 at 10:29:18PM -0800, Omar Sandoval wrote: > Most filesystems prevent truncation of an active swapfile by way of > inode_newsize_ok, called from inode_change_ok. NFS doesn't call either > from nfs_setattr, presumably because most of these checks are expected >

[PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter

2014-12-19 Thread Omar Sandoval
, use ->read_iter/->write_iter with an ITER_BVEC and let the filesystem take care of it. This will also allow us to easily transition to kernel AIO if that gets merged in the future. Cc: Mel Gorman Signed-off-by: Omar Sandoval --- mm/page_io.c | 30 +++--- mm/swapfil

[PATCH v2 5/5] vfs: update swap_{,de}activate documentation

2014-12-19 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 now we use ->{read,write}_iter. Signed-off-by

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

2014-12-19 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 --- 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..b6ca65c 100644 --- a/f

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

2014-12-19 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 Acked-by: Dave Kleikamp Signed-off-by: Omar Sandoval --- fs/direct-io.c | 8 +---

[PATCH v2 0/5] clean up and generalize swap-over-NFS

2014-12-19 Thread Omar Sandoval
g/lkml/2014/12/15/7 Omar Sandoval (5): iov_iter: add ITER_BVEC helpers direct-io: don't dirty ITER_BVEC pages on read nfs: don't dirty ITER_BVEC pages read through direct I/O swapfile: use ->read_iter and ->write_iter vfs: update swap_{,de}activate documentation Doc

[PATCH v2 1/5] iov_iter: add ITER_BVEC helpers

2014-12-19 Thread Omar Sandoval
Add iov_iter_is_bvec and iov_iter_bvec and convert callers. Signed-off-by: Omar Sandoval --- fs/splice.c | 7 ++- include/linux/uio.h | 7 +++ mm/iov_iter.c | 12 mm/page_io.c| 14 +- 4 files changed, 26 insertions(+), 14 deletions

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

2014-12-21 Thread Omar Sandoval
On Sat, Dec 20, 2014 at 06:01:30AM +, Al Viro wrote: > On Fri, Dec 19, 2014 at 07:18:26PM -0800, Omar Sandoval wrote: > > Reads through the iov_iter infrastructure for kernel pages shouldn't be > > dirtied by the direct I/O code. > > > > This is based o

Re: [PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-21 Thread Omar Sandoval
On Sat, Dec 20, 2014 at 06:51:33AM +, Al Viro wrote: > On Mon, Dec 15, 2014 at 08:56:15AM -0800, Christoph Hellwig wrote: > > On Mon, Dec 15, 2014 at 05:27:05PM +0100, Jan Kara wrote: > > > On Sun 14-12-14 21:26:56, Omar Sandoval wrote: > > > > The generic

Re: [PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter

2014-12-21 Thread Omar Sandoval
On Sat, Dec 20, 2014 at 06:13:37AM +, Al Viro wrote: > On Fri, Dec 19, 2014 at 07:18:28PM -0800, Omar Sandoval wrote: > > > + ret = swap_file->f_op->read_iter(&kiocb, &to); > > + if (ret == PAGE_SIZE) { > > +

[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 --- fs/btrfs/extent-tree.c | 41

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

2015-02-24 Thread Omar Sandoval
-by: Omar Sandoval --- 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/btrfs/free-space-cache.c @@ -1112,7

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

2015-02-24 Thread Omar Sandoval
t the reference count on the half-written extent_buffer before unlocking the pages so call 2 won't use it. We should also set exists = NULL in the case that we don't use exists to avoid accidentally returning a freed extent_buffer in an error case. Signed-off-by: Omar Sandoval --- fs/btrfs/

[PATCH v2 0/3] btrfs: ENOMEM bugfixes

2015-02-24 Thread Omar Sandoval
[] while True: l.append(0)' done Version 2 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 b

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

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 > > &g

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

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

[PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Omar Sandoval
=93021 Reported-by: Timo Kokkonen Fixes: bafc9b754f75 ("vfs: More precise tests in d_invalidate") Signed-off-by: Omar Sandoval --- 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 and

[RFC PATCH v2 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 --- Thanks, Al, this is much better. Anything else you'd like me to address for this series? include/linux/uio.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/uio.h b/include/linux/uio

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... > &

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

2015-03-17 Thread Omar Sandoval
Get either READ or WRITE out of iter->type. Signed-off-by: Omar Sandoval --- Ok, let's do that, then. include/linux/uio.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/uio.h b/include/linux/uio.h index 7188029..71889c9 100644 --- a/include/linux/uio.h +++ b

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"

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

2015-03-16 Thread Omar Sandoval
ting some more eyes on is probably 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

[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 --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 4 ++-- fs/9p/vfs_addr.c | 2 +- fs

[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 --- 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/linux/uio.h @@ -1

[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 --- fs/affs/file.c | 2 +- fs/block_dev.c | 5 ++--- fs/btrfs/inode.c| 8 fs/direct-io.c | 39 ++- 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 --- 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 deletions(-) diff

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

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

Re: [PATCH] ext4: fix indirect punch hole corruption

2015-02-06 Thread Omar Sandoval
On Thu, Feb 05, 2015 at 03:30:47PM -0600, Chris J Arges wrote: > On 02/05/2015 02:50 PM, Omar Sandoval wrote: > > Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > > mapping) rewrote FALLOC_FL_PUNCH_HOLE for ext4 files with indirect > > mapping. However, the

[PATCH v2] ext4: fix indirect punch hole corruption

2015-02-07 Thread Omar Sandoval
ing on tracking that down. Signed-off-by: Omar Sandoval --- Once again, this applies to v3.19-rc7. Chris, could you take this one for a spin when you get the chance? Hopefully you'll be able to confirm whether the corruption is still here or unrelated. Changes from v1: Handle partial == chain |

[PATCH v3] ext4: fix indirect punch hole corruption

2015-02-08 Thread Omar Sandoval
xt4_find_shared backed up the shared branch. Signed-off-by: Omar Sandoval --- Here's a couple more fixes folded in. Still applies to v3.19-rc7. Changes from v2: Handle skipped do_indirects when n < 4, n2 == 4, and partial2 == chain2 and skipped ext4_free_branches when nr2 != 0 Changes

[PATCH v2] posix_acl: fix reference leaks in posix_acl_create

2015-02-08 Thread Omar Sandoval
get_acl gets a reference which we must release in the error cases. Reviewed-by: Christoph Hellwig Signed-off-by: Omar Sandoval --- Hi, Al, I'm guessing you're the one to take this one? Just a resend with the proper format and Christoph's Reviewed-by. Thanks! fs/p

Re: [PATCH v3] ext4: fix indirect punch hole corruption

2015-02-09 Thread Omar Sandoval
On Mon, Feb 09, 2015 at 03:03:56PM -0600, Chris J Arges wrote: > On 02/09/2015 12:21 PM, Chris J Arges wrote: > > On 02/08/2015 06:15 AM, Omar Sandoval wrote: > >> Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > >> mapping) rewrote FALLOC_FL_PUN

[PATCH] ext4: fix indirect punch hole corruption

2015-02-05 Thread Omar Sandoval
, let's handle the mismatch and clean up that case. Tested with generic/270, which no longer leads to an inconsistent filesystem like before. Signed-off-by: Omar Sandoval --- fs/ext4/indirect.c | 61 +++--- 1 file changed, 35 insertions(+

Re: [PATCH] ext4: fix indirect punch hole corruption

2015-02-05 Thread Omar Sandoval
On Thu, Feb 05, 2015 at 12:50:13PM -0800, Omar Sandoval wrote: > Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > mapping) rewrote FALLOC_FL_PUNCH_HOLE for ext4 files with indirect > mapping. However, the case where the punch happens within one level of > indirection

Re: [PATCH] ext4: fix indirect punch hole corruption

2015-02-05 Thread Omar Sandoval
On Thu, Feb 05, 2015 at 03:30:47PM -0600, Chris J Arges wrote: > On 02/05/2015 02:50 PM, Omar Sandoval wrote: > > Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > > mapping) rewrote FALLOC_FL_PUNCH_HOLE for ext4 files with indirect > > mapping. However, the

Re: [PATCH] posix_acl: fix reference leaks in posix_acl_create

2015-02-01 Thread Omar Sandoval
On Wed, Jan 28, 2015 at 06:09:52PM +0100, Christoph Hellwig wrote: > On Mon, Jan 26, 2015 at 10:16:53PM -0800, Omar Sandoval wrote: > > get_acl gets a reference which we must release in the error cases. > > > > Signed-off-by: Omar Sandoval > > Looks good, but at this

[PATCH v4] ext4: fix indirect punch hole corruption

2015-02-10 Thread Omar Sandoval
within one level of indirection and ext4_find_shared returns a top branch for the end, then we shouldn't free the block referenced by the end of the returned chain (this mirrors the different levels case). Signed-off-by: Omar Sandoval --- Okay, two more bugfixes folded in, all described in the co

Re: [PATCH v4] ext4: fix indirect punch hole corruption

2015-02-10 Thread Omar Sandoval
On Tue, Feb 10, 2015 at 08:59:23PM -0600, Chris J Arges wrote: > On 02/10/2015 03:44 PM, Omar Sandoval wrote: > > Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > > mapping) rewrote FALLOC_FL_PUNCH_HOLE for ext4 files with indirect > > mapping. However, ther

Re: [PATCH RFC v3 0/7] epoll: Introduce new syscalls, epoll_ctl_batch and epoll_pwait1

2015-02-13 Thread Omar Sandoval
> please skip this part and probably start with the man page style > documentation. > You can resume to this section later.] > > [Thanks to Omar Sandoval , who pointed out this in > reviewing v1] > > We try to report status for each command in epoll_ctl_batch, by writting to > user

Re: [PATCH 1/8] nfs: follow direct I/O write locking convention

2014-12-15 Thread Omar Sandoval
On Mon, Dec 15, 2014 at 07:49:20AM -0500, Trond Myklebust wrote: > On Mon, Dec 15, 2014 at 12:26 AM, Omar Sandoval wrote: > > The generic callers of direct_IO lock i_mutex before doing a write. NFS > > doesn't use the generic write code, so it doesn't follow this >

Re: [PATCH 3/8] swap: don't add ITER_BVEC flag to direct_IO rw

2014-12-15 Thread Omar Sandoval
On Mon, Dec 15, 2014 at 06:16:02AM +, Al Viro wrote: > On Sun, Dec 14, 2014 at 09:26:57PM -0800, Omar Sandoval wrote: > > The rw argument to direct_IO has some ill-defined semantics. Some > > filesystems (e.g., ext4, FAT) decide whether they're doing a write with > &g

Re: [PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-15 Thread Omar Sandoval
On Mon, Dec 15, 2014 at 08:56:15AM -0800, Christoph Hellwig wrote: > On Mon, Dec 15, 2014 at 05:27:05PM +0100, Jan Kara wrote: > > On Sun 14-12-14 21:26:56, Omar Sandoval wrote: > > > The generic write code locks i_mutex for a direct_IO. Swap-over-NFS > > > doe

Re: [PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-16 Thread Omar Sandoval
On Tue, Dec 16, 2014 at 12:35:43AM -0800, Christoph Hellwig wrote: > On Mon, Dec 15, 2014 at 02:11:00PM -0800, Omar Sandoval wrote: > > Ok, I got the swap code working with ->read_iter/->write_iter without > > too much trouble. I wanted to double check before I submit if th

Re: [PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-17 Thread Omar Sandoval
On Wed, Dec 17, 2014 at 12:24:37AM -0800, Christoph Hellwig wrote: > On Wed, Dec 17, 2014 at 08:20:21AM +, Al Viro wrote: > > Where the hell would those other references come from? We open the damn > > thing in sys_swapon(), never put it into descriptor tables, etc. and > > the only reason why

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Omar Sandoval
On Tue, Jan 20, 2015 at 05:57:57PM +0800, Fam Zheng wrote: > This syscall is a sequence of > > 1) a number of epoll_ctl calls > 2) a epoll_pwait, with timeout enhancement. > > The epoll_ctl operations are embeded so that application doesn't have to use > separate syscalls to insert/delete/update

Re: [PATCH v2 0/5] clean up and generalize swap-over-NFS

2015-01-21 Thread Omar Sandoval
On Tue, Jan 13, 2015 at 07:18:36PM -0800, Omar Sandoval wrote: > On Fri, Dec 19, 2014 at 07:18:24PM -0800, Omar Sandoval wrote: > > Hi, > > > > This patch series (based on ecb5ec0 in Linus' tree) contains all of the > > non-BTRFS work that I've done to im

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 contai

[PATCH 0/3] btrfs: ENOMEM bugfixes

2015-02-17 Thread Omar Sandoval
Linus' tree as of today. Thanks! Omar Sandoval (3): btrfs: handle ENOMEM in btrfs_alloc_tree_block btrfs: handle race on ENOMEM in alloc_extent_buffer btrfs: check io_ctl_prepare_pages return in __btrfs_write_out_cache fs/btrfs/extent-tree.c | 41 ++

[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 --- fs/btrfs/extent-tree.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/extent

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

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

[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 --- fs/btrfs/free-space-cache.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/btrfs

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 >

Re: [PATCH v4] ext4: fix indirect punch hole corruption

2015-02-17 Thread Omar Sandoval
On Tue, Feb 10, 2015 at 07:37:20PM -0800, Omar Sandoval wrote: > On Tue, Feb 10, 2015 at 08:59:23PM -0600, Chris J Arges wrote: > > On 02/10/2015 03:44 PM, Omar Sandoval wrote: > > > Commit 4f579ae7de56 (ext4: fix punch hole on files with indirect > > > mapping) rewro

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_m

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 wit

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

2014-12-14 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 Acked-by: Dave Kleikamp Signed-off-by: Omar Sandoval --- fs/direct-io.c | 8 +---

[PATCH 1/8] nfs: follow direct I/O write locking convention

2014-12-14 Thread Omar Sandoval
mentations of direct_IO will expect to have it locked. Signed-off-by: Omar Sandoval --- fs/nfs/direct.c | 12 +--- fs/nfs/file.c | 8 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 10bf072..9402b96 100644 --- a/fs/nf

[PATCH 0/8] clean up and generalize swap-over-NFS

2014-12-14 Thread Omar Sandoval
hrough ->direct_IO rather than ->readpage. Using readpage for a swapcache page requires all sorts of messy workarounds (see here for context: https://lkml.org/lkml/2014/11/19/46). Patch 8 updates the documentation accordingly. Thanks! Omar Sandoval (8): nfs: follow direct I/O write locking

[PATCH 2/8] swap: lock i_mutex for swap_writepage direct_IO

2014-12-14 Thread Omar Sandoval
The generic write code locks i_mutex for a direct_IO. Swap-over-NFS doesn't grab the mutex because nfs_direct_IO doesn't expect i_mutex to be held, but most direct_IO implementations do. Signed-off-by: Omar Sandoval --- mm/page_io.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH 6/8] nfs: don't dirty ITER_BVEC pages read through direct I/O

2014-12-14 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 --- 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 9402b96..a502b3f 100644 --- a/f

[PATCH 8/8] vfs: update swap_{,de}activate documentation

2014-12-14 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 San

[PATCH 4/8] iov_iter: add iov_iter_bvec and convert callers

2014-12-14 Thread Omar Sandoval
Signed-off-by: Omar Sandoval --- fs/splice.c | 7 ++- include/linux/uio.h | 2 ++ mm/iov_iter.c | 12 mm/page_io.c| 14 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index 75c6058..7c7176f 100644

[PATCH 3/8] swap: don't add ITER_BVEC flag to direct_IO rw

2014-12-14 Thread Omar Sandoval
ags but not in rw. This caters to the least common denominator and avoids a sweeping change of every direct_IO implementation for now. Signed-off-by: Omar Sandoval --- mm/page_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 1630ac0..c22

[PATCH 7/8] swap: use direct I/O for SWP_FILE swap_readpage

2014-12-14 Thread Omar Sandoval
On Mon, Nov 17, 2014 at 07:48:17AM -0800, Christoph Hellwig wrote: > With the new iov_iter infrastructure that supprots direct I/O to kernel > pages please get rid of the ->readpage hack first. I'm still utterly > disapoined that this crap ever got merged. Signed-off-by: Omar

[PATCH RESEND 2/2] coredump: only charge written data against RLIMIT_CORE

2016-04-01 Thread Omar Sandoval
From: Omar Sandoval Commit 9b56d54380ad ("dump_skip(): dump_seek() replacement taking coredump_params") introduced a regression with regard to RLIMIT_CORE. Previously, when a core dump was sparse, only the data that was actually written out would count against the limit. Now, the spa

[PATCH RESEND 0/2] fix RLIMIT_CORE accounting for sparse dumps

2016-04-01 Thread Omar Sandoval
From: Omar Sandoval Resending this since it didn't get in -rc1. Rebased on Linus' current tree. Please apply. Original cover letter below: Hi, Someone here reported that they were getting truncated core dumps even when RLIMIT_CORE was larger than the physical memory of the machine

[PATCH RESEND 1/2] coredump: get rid of coredump_params->written

2016-04-01 Thread Omar Sandoval
From: Omar Sandoval cprm->written is redundant with cprm->file->f_pos, so use that instead. --- arch/powerpc/platforms/cell/spufs/coredump.c | 5 +++-- fs/binfmt_elf.c | 2 +- fs/binfmt_elf_fdpic.c| 2 +- fs/c

[PATCH v2 0/2] fix RLIMIT_CORE accounting for sparse dumps

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval Hi, Al, I'm resending these patches because I realized that I made a subtle typo in my first version. I only just noticed that I inadvertently changed this in `dump_emit()`. - cprm->written += n; + cprm->written += nr; That&

[PATCH v2 1/2] coredump: get rid of coredump_params->written

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval cprm->written is redundant with cprm->file->f_pos, so use that instead. --- arch/powerpc/platforms/cell/spufs/coredump.c | 5 +++-- fs/binfmt_elf.c | 2 +- fs/binfmt_elf_fdpic.c| 2 +- fs/c

[PATCH v2 2/2] coredump: only charge written data against RLIMIT_CORE

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval Commit 9b56d54380ad ("dump_skip(): dump_seek() replacement taking coredump_params") introduced a regression with regard to RLIMIT_CORE. Previously, when a core dump was sparse, only the data that was actually written out would count against the limit. Now, the spa

[PATCH v3 2/2] coredump: only charge written data against RLIMIT_CORE

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval Commit 9b56d54380ad ("dump_skip(): dump_seek() replacement taking coredump_params") introduced a regression with regard to RLIMIT_CORE. Previously, when a core dump was sparse, only the data that was actually written out would count against the limit. Now, the spa

[PATCH v3 0/2] fix RLIMIT_CORE accounting for sparse dumps

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval Ugh, and this time I forgot the Signed-off-by... Cover letter from v2 below: Hi, Al, I'm resending these patches because I realized that I made a subtle typo in my first version. I only just noticed that I inadvertently changed this in `dump

[PATCH v3 1/2] coredump: get rid of coredump_params->written

2016-04-11 Thread Omar Sandoval
From: Omar Sandoval cprm->written is redundant with cprm->file->f_pos, so use that instead. Signed-off-by: Omar Sandoval --- arch/powerpc/platforms/cell/spufs/coredump.c | 5 +++-- fs/binfmt_elf.c | 2 +- fs/binfmt_elf_fdpic.c|

Re: [PATCH] block: aoe: no need to check return value of debugfs_create functions

2019-01-22 Thread Omar Sandoval
On Tue, Jan 22, 2019 at 04:21:04PM +0100, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "Ed L. Cashin" > Cc: Jens Axboe

Re: [PATCH 01/11] btrfs: add macros for compression type and level

2019-01-29 Thread Omar Sandoval
On Mon, Jan 28, 2019 at 04:24:27PM -0500, Dennis Zhou wrote: > It is very easy to miss places that rely on a certain bitshifting for > decyphering the type_level overloading. Make macros handle this instead. > > Signed-off-by: Dennis Zhou > --- > fs/btrfs/compression.c | 2 +- > fs/btrfs/compres

Re: [PATCH] sbitmap: trivial - update comment for sbitmap_deferred_clear_bit

2019-03-21 Thread Omar Sandoval
On Sat, Mar 16, 2019 at 04:24:37PM +0800, Shenghui Wang wrote: > "sbitmap_batch_clear" should be "sbitmap_deferred_clear" Acked-by: Omar Sandoval > Signed-off-by: Shenghui Wang > --- > include/linux/sbitmap.h | 2 +- > 1 file changed, 1 insertion(+), 1 de

Re: [PATCH] blk_types.h: Use REQ_OP_WRITE in op_is_write

2019-01-11 Thread Omar Sandoval
On Sat, Dec 22, 2018 at 08:03:54AM -0200, Marcos Paulo de Souza wrote: > Instead of just using plain '1', as it improves readability. > > Signed-off-by: Marcos Paulo de Souza > --- > include/linux/blk_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux

Re: [PATCH] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
On Wed, Aug 29, 2018 at 06:04:07AM +0200, Dominique Martinet wrote: > The 'm' kcore_list item can point to kclist_head, and it is incorrect to > look at m->addr / m->size in this case. > There is no choice but to run through the list of entries for every address > if we did not find any entry in th

Re: [PATCH v3] proc/kcore: fix invalid memory access in multi-page read optimization

2018-09-04 Thread Omar Sandoval
we did not find any entry in the previous iteration > > Reset 'm' to NULL in that case at Omar Sandoval's suggestion. > > Fixes: bf991c2231117 ("proc/kcore: optimize multiple page reads") Reviewed-by: Omar Sandoval Thanks again for catching this! > Si

[PATCH] Documentation: document hung_task_panic kernel parameter

2018-05-21 Thread Omar Sandoval
From: Omar Sandoval This parameter has been around since commit e162b39a368f ("softlockup: decouple hung tasks check from softlockup detection") in 2009 but was never documented. Signed-off-by: Omar Sandoval --- Documentation/admin-guide/kernel-parameters.txt | 10 ++ 1 fi

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-21 Thread Omar Sandoval
On Mon, May 21, 2018 at 03:11:08PM +, Bart Van Assche wrote: > On Sun, 2018-05-20 at 19:58 -0400, Kent Overstreet wrote: > > On Sun, May 20, 2018 at 11:40:45PM +, Bart Van Assche wrote: > > > On Sun, 2018-05-20 at 19:21 -0400, Kent Overstreet wrote: > > > > I really have better things to do

[PATCH] bitmap: fix memset optimization on big-endian systems

2018-04-02 Thread Omar Sandoval
From: Omar Sandoval Commit 2a98dc028f91 introduced an optimization to bitmap_{set,clear}() which uses memset() when the start and length are constants aligned to a byte. This is wrong on big-endian systems; our bitmaps are arrays of unsigned long, so bit n is not at byte n / 8 in memory. This

Re: [PATCH] bitmap: fix memset optimization on big-endian systems

2018-04-02 Thread Omar Sandoval
On Mon, Apr 02, 2018 at 03:58:31PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Commit 2a98dc028f91 introduced an optimization to bitmap_{set,clear}() > which uses memset() when the start and length are constants aligned to a > byte. This is wrong on big-endian systems;

Re: [PATCH 2/2] tracing/events: block: dev_t via driver core for plug and unplug events

2018-04-19 Thread Omar Sandoval
On Mon, Apr 16, 2018 at 06:33:27PM +0200, Steffen Maier wrote: > Hi Greg, > > On 04/15/2018 10:31 AM, Greg Kroah-Hartman wrote: > > On Fri, Apr 13, 2018 at 03:07:18PM +0200, Steffen Maier wrote: > > > diff --git a/include/trace/events/block.h b/include/trace/events/block.h > > > index a13613d27cee

[PATCH] lockdep: fix fs_reclaim annotation

2018-04-15 Thread Omar Sandoval
From: Omar Sandoval While revisiting my Btrfs swapfile series [1], I introduced a situation in which reclaim would lock i_rwsem, and even though the swapon() path clearly made GFP_KERNEL allocations while holding i_rwsem, I got no complaints from lockdep. It turns out that the rework of the

debugfs vs. device removal

2017-01-19 Thread Omar Sandoval
Hi, In the block layer, we abuse sysfs to export some per-device debugging information. I was looking into moving this to debugfs, but I realized that debugfs doesn't have a mechanism to ensure that a file associated with a device is safe to use when the device is removed. At a quick glance, HID

Re: debugfs vs. device removal

2017-01-19 Thread Omar Sandoval
On Thu, Jan 19, 2017 at 05:03:48PM +0100, Jiri Kosina wrote: > On Thu, 19 Jan 2017, Greg Kroah-Hartman wrote: > > > > In the block layer, we abuse sysfs to export some per-device debugging > > > information. I was looking into moving this to debugfs, but I realized > > > that debugfs doesn't have

Re: [PATCH 08/10] blk-mq-sched: add framework for MQ capable IO schedulers

2017-01-13 Thread Omar Sandoval
On Fri, Jan 13, 2017 at 12:15:17PM +0100, Hannes Reinecke wrote: > On 01/11/2017 10:40 PM, Jens Axboe wrote: > > This adds a set of hooks that intercepts the blk-mq path of > > allocating/inserting/issuing/completing requests, allowing > > us to develop a scheduler within that framework. > > > > W

<    1   2   3   4   >