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

2015-01-09 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. Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney Signed-off-by: Omar Sandoval --- fs/btrfs/

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

2015-01-09 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 --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/

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

2015-01-09 Thread Omar Sandoval
mption 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 btrfs_device->name updates btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INF

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

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

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

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

2015-01-12 Thread Omar Sandoval
On Sat, Jan 10, 2015 at 05:08:03PM -0500, Trond Myklebust wrote: > Hi Omar, > > On Thu, Jan 8, 2015 at 4:18 AM, Omar Sandoval wrote: > > Most filesystems prevent truncation of an active swapfile by way of > > inode_newsize_ok, called from inode_change_ok. NFS doesn&#

[PATCH] posix_acl: fix reference leaks in posix_acl_create

2015-01-26 Thread Omar Sandoval
get_acl gets a reference which we must release in the error cases. Signed-off-by: Omar Sandoval --- fs/posix_acl.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 0855f77..f8f3cc2 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c

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, >

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

2015-04-03 Thread Omar Sandoval
On Thu, Apr 02, 2015 at 05:02:25PM +0200, David Sterba wrote: > On Wed, Apr 01, 2015 at 08:49:54PM -0700, Omar Sandoval wrote: > > Hm, yeah, that's unfortunate, thanks for pointing that out. It looks > > like we can get the subvolume ID reliably: > > > > >

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 direct

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 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 bafc9b75

[PATCH 1/3] Btrfs: lock superblock before remounting for rw subvol

2015-04-07 Thread Omar Sandoval
create /mnt/vol1 btrfs subvol create /mnt/vol2 umount /mnt mount -oro,subvol=/vol1 /dev/vdb /mnt mount -orw,subvol=/vol2 /dev/vdb /mnt2 Fixes: 0723a0473fb4 Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/super.c b/fs/btrfs/supe

[PATCH 2/3] Btrfs: unify subvol= and subvolid= mounting

2015-04-07 Thread Omar Sandoval
ubvol= case. To unify the code paths, when given subvolid= or using the default subvolume ID, translate it into a subvolume name by walking ROOT_BACKREFs in the root tree and INODE_REFs in the filesystem trees. Signed-off-by: Omar Sandoval --- fs/btrf

[PATCH 0/3] Btrfs: show subvolume name and ID in /proc/mounts

2015-04-07 Thread Omar Sandoval
;ve tested it manually and with the script below. Thank you! Omar Sandoval (3): Btrfs: lock superblock before remounting for rw subvol Btrfs: unify subvol= and subvolid= mounting Btrfs: show subvol= and subvolid= in /proc/mounts fs/btrfs/sup

[PATCH 3/3] Btrfs: show subvol= and subvolid= in /proc/mounts

2015-04-07 Thread Omar Sandoval
Currently, userspace has no way to know which subvolume is mounted. But, now that we're guaranteed to have a meaningful root dentry, we can just export and use seq_dentry() in btrfs_show_options(). The subvolume ID is easy to get, so put that in there, too. Signed-off-by: Omar Sandoval --

Re: [PATCH 2/3] Btrfs: unify subvol= and subvolid= mounting

2015-04-08 Thread Omar Sandoval
On Wed, Apr 08, 2015 at 02:06:14PM +0800, Qu Wenruo wrote: > > > Original Message > Subject: [PATCH 2/3] Btrfs: unify subvol= and subvolid= mounting > From: Omar Sandoval > To: Chris Mason , Josef Bacik , David Sterba > , > Date: 2015年04月08日 13:34 >

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

2015-04-10 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. Reviewed-by: Filipe Manana Reviewed-by: David Sterba Cc: sta...@vger.kernel.org Signed-off-by: Omar Sandoval --- Just resending this with Filipe's and David

[PATCH v2 2/6] Btrfs: remove all subvol options before mounting top-level

2015-04-09 Thread Omar Sandoval
check for that. This also makes setup_root_args() more generic, which we'll need soon. Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 56 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/fs/btrfs/super.c b/fs/bt

[PATCH v2 3/6] Btrfs: clean up error handling in mount_subvol()

2015-04-09 Thread Omar Sandoval
In preparation for new functionality in mount_subvol(), give it ownership of subvol_name and tidy up the error paths. Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 61 ++-- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a

[PATCH v2 1/6] Btrfs: lock superblock before remounting for rw subvol

2015-04-09 Thread Omar Sandoval
create /mnt/vol1 btrfs subvol create /mnt/vol2 umount /mnt mount -oro,subvol=/vol1 /dev/vdb /mnt mount -orw,subvol=/vol2 /dev/vdb /mnt2 Fixes: 0723a0473fb4 ("btrfs: allow mounting btrfs subvolumes with different ro/rw options") Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 2 ++ 1

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

2015-04-09 Thread Omar Sandoval
0-rc7. Tested manually and with the script below (updated from v1). Thanks! Omar Sandoval (6): Btrfs: lock superblock before remounting for rw subvol Btrfs: remove all subvol options before mounting top-level Btrfs: clean up error handling in mount_subvol() Btrfs: fail on mismatched subvo

[PATCH v2 4/6] Btrfs: fail on mismatched subvol and subvolid mount options

2015-04-09 Thread Omar Sandoval
t of /proc/mounts). Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index ab100e5..20b470d 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1163

Re: [PATCH 2/3] Btrfs: unify subvol= and subvolid= mounting

2015-04-09 Thread Omar Sandoval
On Thu, Apr 09, 2015 at 06:28:48PM +0200, David Sterba wrote: > On Tue, Apr 07, 2015 at 10:34:01PM -0700, Omar Sandoval wrote: > > Currently, mounting a subvolume with subvolid= takes a different code > > path than mounting with subvol=. This isn't really a big deal except f

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

2015-04-09 Thread Omar Sandoval
ubvol= case. To unify the code paths, when given subvolid= or using the default subvolume ID, translate it into a subvolume name by walking ROOT_BACKREFs in the root tree and INODE_REFs in the filesystem trees. Signed-off-by: Omar Sandoval --- fs/btrf

[PATCH v2 6/6] Btrfs: show subvol= and subvolid= in /proc/mounts

2015-04-09 Thread Omar Sandoval
Now that we're guaranteed to have a meaningful root dentry, we can just export seq_dentry() and use it in btrfs_show_options(). The subvolume ID is easy to get and can also be useful, so put that in there, too. Signed-off-by: Omar Sandoval --- fs/btrfs/super.c | 4 fs/seq_file.c

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

2015-04-13 Thread Omar Sandoval
On Fri, Mar 27, 2015 at 02:06:49PM -0700, Omar Sandoval wrote: > 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: > > > &

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

2015-04-13 Thread Omar Sandoval
On Fri, Apr 10, 2015 at 02:20:40PM -0700, Omar Sandoval wrote: > Whenever the check for a send in progress introduced in commit > 521e0546c970 (btrfs: protect snapshots from deleting during send) is > hit, we return without unlocking inode->i_mutex. This is easy to see > with

[PATCH] trace-cmd: annotate function durations like the kernel

2015-06-24 Thread Omar Sandoval
Since kernel commit, 8e1e1df29d83 ("tracing: Add additional marks to signal very large time deltas") the kernel annotates durations longer than 1000 usecs with # and longer than 1 sec with $. Update trace-cmd report to be consistent with it. Signed-off-by: Omar Sandoval --- Just a mino

Re: [PATCH] block: kyber: make kyber more friendly with merging

2018-05-22 Thread Omar Sandoval
On Tue, May 22, 2018 at 10:48:29PM +0800, Jianchao Wang wrote: > Currently, kyber is very unfriendly with merging. kyber depends > on ctx rq_list to do merging, however, most of time, it will not > leave any requests in ctx rq_list. This is because even if tokens > of one domain is used up, kyber w

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

2018-04-03 Thread Omar Sandoval
On Mon, Apr 02, 2018 at 04:49:39PM -0700, Linus Torvalds wrote: > On Mon, Apr 2, 2018 at 4:37 PM, Linus Torvalds > wrote: > > > > We should probably have at least switched it to "unsigned long int" > > I meant just "unsigned int", of course. > > Right now we occasionally have a silly 64-bit fiel

Please add 21035965f60b ("bitmap: fix memset optimization on big-endian systems") to the stable tree

2018-04-03 Thread Omar Sandoval
Just wanted to make sure this doesn't get missed because I misspelled the stable email address in the patch. It applies to v4.13+.

Re: [PATCH] lockdep: fix fs_reclaim annotation

2018-04-24 Thread Omar Sandoval
On Fri, Apr 20, 2018 at 10:17:42AM +0200, Peter Zijlstra wrote: > On Sun, Apr 15, 2018 at 12:42:25AM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > While revisiting my Btrfs swapfile series [1], I introduced a situation > > in which reclaim would lock i

Re: [PATCH v2] kyber: introduce kyber_depth_updated()

2021-02-22 Thread Omar Sandoval
t able to reproduce the hang, but this looks correct, and it passed my tests. Reviewed-by: Omar Sandoval > --- > v2: > - Change the commit message > - Change from sbitmap::depth to 2^sbitmap::shift > --- > block/kyber-iosched.c | 29 + > 1 file cha

[PATCH] ARM: Don't oops when userspace executes kgdb break instructions.

2014-07-18 Thread Omar Sandoval
Don't break into kgdb when userspace executes the kernel break instructions (KGDB_BREAKINST and KGDB_COMPILED_BREAK). The kernel will oops in kgdb_handle_exception. Signed-off-by: Omar Sandoval --- The following program will immediately cause a kernel oops: .globl _start _start:

Re: [PATCH] ARM: Don't oops when userspace executes kgdb break instructions.

2014-07-19 Thread Omar Sandoval
On Fri, Jul 18, 2014 at 03:51:31PM -0700, Omar Sandoval wrote: > Don't break into kgdb when userspace executes the kernel break instructions > (KGDB_BREAKINST and KGDB_COMPILED_BREAK). The kernel will oops in > kgdb_handle_exception. > > Signed-off-by: Omar Sandoval > ---

[PATCH] ARM/ARM64: don't enter kgdb when userspace executes a kgdb break instruction.

2014-07-30 Thread Omar Sandoval
KGDB_COMPILED_BREAK on ARM, or brk #KGDB_{DYN,COMPILED}_DGB_BRK_IMM on ARM64. Signed-off-by: Omar Sandoval --- The following program reproduces the fixed problem on ARM: .globl _start _start: udf #65006 @ KGDB_BREAKINST And on ARM64: .globl _start _start: brk #0x400

Re: [PATCH] ARM/ARM64: don't enter kgdb when userspace executes a kgdb break instruction.

2014-07-30 Thread Omar Sandoval
Hi, On Wed, Jul 30, 2014 at 12:24:14PM +0100, Will Deacon wrote: > Whilst this sounds like a worrying problem, I've failed to reproduce it > on arm64. Executing a brk instruction with either KGDB_DYN_DGB_BRK_IMM or > KDBG_COMPILED_DBG_BRK_IMM immediates from userspace results in a SIGTRAP being >

[PATCH] ARM: don't enter kgdb when userspace executes a kgdb break instruction.

2014-07-31 Thread Omar Sandoval
KGDB_COMPILED_BREAK. Signed-off-by: Omar Sandoval --- On a kernel running with kgdb enabled, this program reproduces the problem: .globl _start _start: udf #65006 @ KGDB_BREAKINST The same problem has been fixed in ARM64. arch/arm/kernel/kgdb.c | 4 1 file changed, 4 insertions(+) diff

Re: [PATCH] ARM/ARM64: don't enter kgdb when userspace executes a kgdb break instruction.

2014-07-31 Thread Omar Sandoval
Hi, Will, On Thu, Jul 31, 2014 at 11:46:53AM +0100, Will Deacon wrote: > I'll merge the arm64 diff I proposed. Could you repost the ARM part please? I've just reposted it, hopefully we can get that merged in soon as well. > I think enabling and activating kgdb by default is a pretty crazy thing t

[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 --- This patch applies to 3.17-rc5. fs/btrfs/check-integrity.c

[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 --- 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..67534bc 100644

[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 --- fs/btrfs/check-integrity.c | 6 +-- fs/btrfs/dev-replace.c

[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] staging: lustre: fix gfp_t/int coercion

2014-09-26 Thread Omar Sandoval
Fix a few implicit casts between int and gfp_t which were caught by sparse. Signed-off-by: Omar Sandoval --- This patch applies to v3.17-rc6. drivers/staging/lustre/lustre/llite/lloop.c| 4 ++-- drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +- drivers/staging/lustre

[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 Acked-by: Paul E. McKenney --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h

[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/b

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

2014-09-26 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 Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney --- fs/btrfs/

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 th

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 val

[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 Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney --- Vers

[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 --- fs/btrfs/ctree.c| 3 ++- fs/btrfs/extent-tree.c | 1 + fs/btrfs

[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 --- fs/btrfs/ioctl.c | 6 +++--- fs/btrfs/send.c | 8 2 files changed, 7 insertions(+), 7

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

2014-09-28 Thread Omar Sandoval
less straightforward sparse warnings still remaining. Omar Sandoval (2): btrfs: fix sparse address space warnings btrfs: fix sparse lock context warnings fs/btrfs/ctree.c| 3 ++- fs/btrfs/extent-tree.c | 1 + fs/btrfs/extent_io.c| 2 +- fs/btrfs/free-space-cache.c | 1 + fs/

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 logic

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, > u3

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

2014-09-29 Thread Omar Sandoval
On Mon, Sep 29, 2014 at 06:07:38PM +0200, David Sterba wrote: > On Sun, Sep 28, 2014 at 01:48:11AM -0700, Omar Sandoval wrote: > > 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 s

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

2014-09-30 Thread Omar Sandoval
On Mon, Sep 29, 2014 at 11:49:54PM +0200, David Sterba wrote: > On Mon, Sep 29, 2014 at 12:45:12PM -0700, Omar Sandoval wrote: > > > > @@ -639,8 +640,7 @@ static int send_header(struct send_ctx *sctx) > > > > - return write_buf(sctx-&

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

2014-09-30 Thread Omar Sandoval
less 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 kerne

[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 --- fs/btrfs/send.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/fs/btrfs

[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 Reviewed-by: David Sterba --- fs/btrfs/extent-tree.c | 1 + fs/btrfs/extent_io.c

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

2014-09-30 Thread Omar Sandoval
Several casts of ioctl fields from userspace are missing the __user annotation. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8a8e298..0f9a5a1

[PATCH] staging: bcm: sort.c: fix coding style

2014-09-06 Thread Omar Sandoval
Fix checkpatch.pl "Alignment should match open parenthesis". Signed-off-by: Omar Sandoval --- drivers/staging/bcm/sort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/bcm/sort.c b/drivers/staging/bcm/sort.c index d518c42..ca0b179 100644 ---

[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 Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney --- Vers

[PATCH v5] Move BTRFS RCU string to common library

2014-11-07 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. Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney Signed-off-by: Omar Sandoval --- Chris, coul

[PATCH v6] Move BTRFS RCU string to common library

2014-11-08 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. Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney Signed-off-by: Omar Sandoval --- Chris, i

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

Re: [PATCH] trace-cmd: annotate function durations like the kernel

2015-07-29 Thread Omar Sandoval
On Mon, Jul 13, 2015 at 02:43:19PM -0400, Steven Rostedt wrote: > On Wed, 24 Jun 2015 11:36:54 -0700 > Omar Sandoval wrote: > > > Since kernel commit, 8e1e1df29d83 ("tracing: Add additional marks to > > signal very large time deltas") the kernel annotates durat

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

2016-05-11 Thread Omar Sandoval
From: Omar Sandoval Al, could you please apply this series for v4.7? I first sent it out during the v4.5 cycle, it'd be great to be done with it, especially since it's fixing a regression. Here's the cover letter from v1: http://www.spinics.net/lists/linux-fsdevel/msg94735.html

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

2016-05-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|

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

2016-05-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

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

2014-11-18 Thread Omar Sandoval
y of this, so please let me know if I'm spewing nonsense :) -- Omar >From e58c52e69a9aef07c0089f9ce552fca96d42bce9 Mon Sep 17 00:00:00 2001 Message-Id: From: Omar Sandoval Date: Tue, 18 Nov 2014 22:42:10 -0800 Subject: [PATCH] swap: use direct_IO for swap_readpage S

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

[PATCH v7] Move BTRFS RCU string to common library

2014-11-13 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. Reviewed-by: Josh Triplett Acked-by: Paul E. McKenney Signed-off-by: Omar Sandoval --- Alright, h

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

2014-11-30 Thread Omar Sandoval
e first patch fixes the __rcu annotations which I got wrong on the first go. The second fixes an incorrect 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&

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

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

[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 San

[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 --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/

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 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 a

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 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 derefere

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

2014-11-21 Thread Omar Sandoval
es with either for swap. - 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

[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 --- 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 100644 --- a/f

[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 --- fs/btrfs/inode.c

[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 --- fs/btrfs/ioctl.c | 50 +++--- 1 file changed, 31 insertions(+), 19 dele

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 thi

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-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http

[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 Cc: Ming Lei Signed-off-by: Omar Sandoval --- fs/direct-io.c | 8 +--- 1

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

2014-11-21 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. Cc: Mel Gorman Si

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) { > > + p

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

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

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

2014-11-17 Thread Omar Sandoval
fic to BTRFS: - We can't do direct I/O 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'

[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 --- fs/btrfs/inode.c

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

2014-11-17 Thread Omar Sandoval
foolproof. fs/btrfs/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 --- fs/btrfs/disk-io.c| 16 +++---

[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 Sandova

[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 --- fs/btrfs/ioctl.c | 50 +++--- 1 file changed, 31 insertions(+), 19 dele

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

2014-11-17 Thread Omar Sandoval
Signed-off-by: Omar Sandoval --- 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 @@ static int

[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 --- 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 9b67b37..54b2

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-o

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

2014-10-09 Thread Omar Sandoval
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. Signed-off-by: Omar Sandoval --- net/sched/em_text.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/em_text.c b/net/sched/em_text.c index

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 09:05:21AM -0700, 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. > > Signed-off-by: Omar Sandoval > --- > net/sched/em_text.c | 2 ++

<    1   2   3   4   >