Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-02 Thread Jeff Layton
On Wed, 3 Dec 2014 12:11:18 +1100 NeilBrown ne...@suse.de wrote: On Tue, 2 Dec 2014 13:24:09 -0500 Jeff Layton jlay...@primarydata.com wrote: tl;dr: this code works and is much simpler than the dedicated thread pool, but there are some latencies in the workqueue code

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-03 Thread Jeff Layton
On Wed, 3 Dec 2014 10:56:49 -0500 Tejun Heo t...@kernel.org wrote: Hello, Neil, Jeff. On Tue, Dec 02, 2014 at 08:29:46PM -0500, Jeff Layton wrote: That's a good point. I had originally thought that max_active on an unbound workqueue would be the number of concurrent jobs that could run

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-03 Thread Jeff Layton
On Wed, 3 Dec 2014 11:04:05 -0500 Jeff Layton jlay...@primarydata.com wrote: On Wed, 3 Dec 2014 10:56:49 -0500 Tejun Heo t...@kernel.org wrote: Hello, Neil, Jeff. On Tue, Dec 02, 2014 at 08:29:46PM -0500, Jeff Layton wrote: That's a good point. I had originally thought

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-03 Thread Jeff Layton
On Wed, 3 Dec 2014 14:08:01 -0500 Trond Myklebust trond.mykleb...@primarydata.com wrote: On Wed, Dec 3, 2014 at 2:02 PM, Jeff Layton jeff.lay...@primarydata.com wrote: On Wed, 3 Dec 2014 11:04:05 -0500 Jeff Layton jlay...@primarydata.com wrote: On Wed, 3 Dec 2014 10:56:49 -0500 Tejun

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-03 Thread Jeff Layton
On Wed, 3 Dec 2014 14:59:43 -0500 Trond Myklebust trond.mykleb...@primarydata.com wrote: On Wed, Dec 3, 2014 at 2:20 PM, Jeff Layton jeff.lay...@primarydata.com wrote: On Wed, 3 Dec 2014 14:08:01 -0500 Trond Myklebust trond.mykleb...@primarydata.com wrote: Which workqueue are you using

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-04 Thread Jeff Layton
On Wed, 3 Dec 2014 15:44:31 -0500 Trond Myklebust trond.mykleb...@primarydata.com wrote: On Wed, Dec 3, 2014 at 3:21 PM, Jeff Layton jeff.lay...@primarydata.com wrote: On Wed, 3 Dec 2014 14:59:43 -0500 Trond Myklebust trond.mykleb...@primarydata.com wrote: On Wed, Dec 3, 2014 at 2:20

Re: [PATCH] fs: nfsd: Fix bug in compare_blob

2014-12-04 Thread Jeff Layton
, but this is not a particularly hot codepath and so I'm ok with this. This should probably also go to stable. Reviewed-by: Jeff Layton jlay...@primarydata.com -- 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

Re: [RFC PATCH 00/14] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-04 Thread Jeff Layton
tuning to do here before this is quite ready for prime-time. It may be worth testing in your environment though if you have the time and ability to do so. On 12/04/2014 03:47 AM, Jeff Layton wrote: I was using ftrace with the sunrpc:* and workqueue:* tracepoints, and had a simple perl script

Re: [RFC PATCH 09/14] sunrpc: add basic support for workqueue-based services

2014-12-08 Thread Jeff Layton
On Mon, 8 Dec 2014 15:47:09 -0500 J. Bruce Fields bfie...@fieldses.org wrote: On Tue, Dec 02, 2014 at 01:24:18PM -0500, Jeff Layton wrote: diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index fb78117b896c..08e01949bdc5 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig

[PATCH v2 00/16] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-10 Thread Jeff Layton
or comments are welcome. Jeff Layton (16): sunrpc: add a new svc_serv_ops struct and move sv_shutdown into it sunrpc: move sv_function into sv_ops sunrpc: move sv_module parm into sv_ops sunrpc: turn enqueueing a svc_xprt into a svc_serv operation sunrpc: abstract out svc_set_num_threads

[PATCH v2 13/16] sunrpc: keep a cache of svc_rqsts for each NUMA node

2014-12-10 Thread Jeff Layton
NUMA-aware, we can use a NUMA-aware shrinker as well. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/nfsd/nfssvc.c | 11 ++-- include/linux/sunrpc/svc.h | 11 net/sunrpc/svc.c | 1 + net/sunrpc/svc_wq.c| 158

[PATCH v2 06/16] sunrpc: move pool_mode definitions into svc.h

2014-12-10 Thread Jeff Layton
is in use. Likewise, export svc_pool_map_get/put function to make it safe to do so. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/sunrpc/svc.h | 25 + net/sunrpc/svc.c | 31 +++ 2 files changed, 32 insertions

[PATCH v2 16/16] sunrpc: add tracepoints around svc_sock handling

2014-12-10 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/trace/events/sunrpc.h | 46 +++ net/sunrpc/svcsock.c | 6 ++ 2 files changed, 52 insertions(+) diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index

[PATCH v2 14/16] sunrpc: add more tracepoints around svc_xprt handling

2014-12-10 Thread Jeff Layton
Turn the svc_xprt_dequeue and svc_xprt_do_enqueue tracepoints into a event classes, and use them to add events for svc_xprt_enqueued, svc_xprt_active, svc_xprt_received, and svc_xprt_enqueue. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/trace/events/sunrpc.h | 36

[PATCH v2 15/16] sunrpc: print the svc_rqst pointer value in svc_process tracepoint

2014-12-10 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/trace/events/sunrpc.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 41e09a1b962d..0d54473d9b37 100644 --- a/include/trace/events/sunrpc.h

[PATCH v2 11/16] nfsd: keep a reference to the fs_struct in svc_rqst

2014-12-10 Thread Jeff Layton
and then switch to using that in the nfsd function. Once we add workqueue support, we'll have the work function switch to the new fs struct when doing the work and then switch it back. Cc: Al Viro v...@zeniv.linux.org.uk Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/fs_struct.c | 59

[PATCH v2 12/16] nfsd: add support for workqueue based service processing

2014-12-10 Thread Jeff Layton
Allow nfsd to create a workqueue based nfsd service if the sunrpc pool_mode is set to workqueue. The first iteration here is fairly simple. The xprt work simply allocates a svc_rqst object, and then queues that work. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/fs_struct.c

[PATCH v2 09/16] sunrpc: set up svc_rqst work if it's defined

2014-12-10 Thread Jeff Layton
We want to queue most of the work in the context of the svc_rqst. Add a work_struct to the svc_rqst and a new operation for svc_rqst_work. If that's defined then initialize it when setting up the service. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/sunrpc/svc.h | 4

[PATCH v2 08/16] sunrpc: set up workqueue function in svc_xprt

2014-12-10 Thread Jeff Layton
For workqueue-based services we'll want to queue a workqueue job whenever a xprt needs to be serviced. Add a work_struct to svc_xprt and initialize it from a new work_func_t field in the svc_serv_ops. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/sunrpc/svc.h | 3

[PATCH v2 05/16] sunrpc: abstract out svc_set_num_threads to sv_ops

2014-12-10 Thread Jeff Layton
Add an operation that will do setup of the service. In the case of a classic thread-based service that means starting up threads. In the case of a workqueue-based service, the setup will do something different. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/nfsd/nfssvc.c | 8

[PATCH v2 02/16] sunrpc: move sv_function into sv_ops

2014-12-10 Thread Jeff Layton
Since we now have a container for holding svc_serv operations, move the sv_function into it as well. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/nfsd/nfssvc.c | 3 ++- include/linux/sunrpc/svc.h | 11 +++ net/sunrpc/svc.c | 8 +++- 3 files changed

[PATCH v2 04/16] sunrpc: turn enqueueing a svc_xprt into a svc_serv operation

2014-12-10 Thread Jeff Layton
For now, all services use svc_xprt_do_enqueue, but once we add workqueue-based service support, we'll need to do something different. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/lockd/svc.c | 3 ++- fs/nfs/callback.c | 1 + fs/nfsd/nfssvc.c

[PATCH v2 07/16] sunrpc: factor svc_rqst allocation and freeing from sv_nrthreads refcounting

2014-12-10 Thread Jeff Layton
In later patches, we'll want to be able to allocate and free svc_rqst structures without monkeying with the serv-sv_nrthreads refcount. Factor those pieces out of their respective functions. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/sunrpc/svc.h | 3 +++ net/sunrpc

[PATCH v2 01/16] sunrpc: add a new svc_serv_ops struct and move sv_shutdown into it

2014-12-10 Thread Jeff Layton
In later patches we'll need to abstract out more operations on a per-service level, besides sv_shutdown and sv_function. Declare a new svc_serv_ops struct to hold these operations, and move sv_shutdown into this struct. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/lockd/svc.c

[PATCH v2 03/16] sunrpc: move sv_module parm into sv_ops

2014-12-10 Thread Jeff Layton
...not technically an operation, but it's more convenient and cleaner to pass the module pointer in this struct. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/nfsd/nfssvc.c | 3 ++- include/linux/sunrpc/svc.h | 9 ++--- net/sunrpc/svc.c | 8 +++- 3 files

[PATCH v2 10/16] sunrpc: add basic support for workqueue-based services

2014-12-10 Thread Jeff Layton
of this is quite simple. When a svc_xprt needs to be serviced we queue its work and return. In later patches, we'll optimize this a bit more. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/sunrpc/svc.h | 8 ++- include/linux/sunrpc/svc_xprt.h | 1 + include/linux

Re: [PATCH v2 00/16] nfsd/sunrpc: add support for a workqueue-based nfsd

2014-12-10 Thread Jeff Layton
On Wed, 10 Dec 2014 14:31:55 -0800 Chuck Lever chuck.le...@oracle.com wrote: Hi Jeff- On Dec 10, 2014, at 11:07 AM, Jeff Layton jlay...@primarydata.com wrote: This is the second revision of the workqueue-based nfsd. Changes from the RFC version I posted earlier: v2: - found

[PATCH v3 11/13] locks: keep a count of locks on the flctx lists

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com This makes things a bit more efficient in the cifs and ceph lock pushing code. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs/ceph/locks.c| 11 ++- fs/cifs/file.c | 14 -- fs

[PATCH v3 03/13] locks: add a new struct file_locking_context pointer to struct inode

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com The current scheme of using the i_flock list is really difficult to manage. There is also a legitimate desire for a per-inode spinlock to manage these lists that isn't the i_lock. Start conversion to a new scheme to eventually replace the old i_flock

[PATCH v3 13/13] locks: update comments that refer to inode-i_flock

2015-01-22 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 2 +- include/linux/fs.h | 19 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 2fc36b3772a0..4d0d41163a50 100644 --- a/fs/locks.c +++ b/fs/locks.c

[PATCH v3 06/13] locks: convert posix locks to file_lock_context

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs/ceph/locks.c | 58 +--- fs/cifs/file.c | 26 + fs/lockd/svcsubs.c | 20 ++ fs/locks.c

[PATCH v3 04/13] ceph: move spinlocking into ceph_encode_locks_to_buffer and ceph_count_locks

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com There is only a single call site for each of these functions, and the caller takes the i_lock prior to calling them and drops it just afterward. Move the spinlocking into the functions instead. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked

Re: [PATCH v3 00/13] locks: saner method for managing file locks

2015-02-02 Thread Jeff Layton
*fl) { if (cmd == F_GETLK) return posix_test_lock(filp, fl); return posix_lock_file(filp, fl, fl); } ...untested of course, but you get the idea. On Thu, Jan 22, 2015 at 9:27 AM, Jeff Layton jeff.lay...@primarydata.com wrote: v3: - break out a ceph locking

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-06 Thread Jeff Layton
...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc: David Howells dhowe...@redhat.com Cc: Trond Myklebust trond.mykleb...@primarydata.com Cc: Oleg Nesterov onest...@redhat.com Cc: Eric W. Biederman ebied...@xmission.com Cc: Jeff Layton jeff.lay

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-08 Thread Jeff Layton
On Sun, 08 Feb 2015 11:07:32 +0800 Ian Kent ik...@redhat.com wrote: On Fri, 2015-02-06 at 07:08 -0500, Jeff Layton wrote: On Thu, 05 Feb 2015 10:34:11 +0800 Ian Kent ik...@redhat.com wrote: The call_usermodehelper() function executes all binaries in the global init root context

Re: [RFC PATCH 3/5] kmod - teach call_usermodehelper() to use a namespace

2015-01-15 Thread Jeff Layton
...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc: David Howells dhowe...@redhat.com Cc: Trond Myklebust trond.mykleb...@primarydata.com Cc: Oleg Nesterov onest...@redhat.com Cc: Eric W. Biederman ebied...@xmission.com Cc: Jeff Layton jeff.lay

Re: [GIT PULL] please pull file-locking related bugfix for v3.19 (and v3.18 stable)

2015-01-14 Thread Jeff Layton
On Thu, 15 Jan 2015 10:40:25 +1300 Linus Torvalds torva...@linux-foundation.org wrote: On Thu, Jan 15, 2015 at 1:46 AM, Jeff Layton jlay...@poochiereds.net wrote: git://git.samba.org/jlayton/linux.git 52d304eb4eaced9ad04b64ba7cd6ceb5153bbf18 Ugh. What are you doing? Don't send me

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-15 Thread Jeff Layton
On Wed, 14 Jan 2015 18:44:41 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/14/2015 09:27 AM, Jeff Layton wrote: On Tue, 13 Jan 2015 17:50:45 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/13/2015 04:44 PM, Jeff Layton wrote: On Tue, 13 Jan 2015 00:11:37 -0500 Sasha

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-16 Thread Jeff Layton
On Fri, 16 Jan 2015 13:10:46 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/16/2015 09:40 AM, Jeff Layton wrote: On Fri, 16 Jan 2015 09:31:23 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/15/2015 03:22 PM, Jeff Layton wrote: Ok, I tried to reproduce

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-16 Thread Jeff Layton
On Fri, 16 Jan 2015 13:53:04 -0500 Jeff Layton jlay...@primarydata.com wrote: On Fri, 16 Jan 2015 13:10:46 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/16/2015 09:40 AM, Jeff Layton wrote: On Fri, 16 Jan 2015 09:31:23 -0500 Sasha Levin sasha.le...@oracle.com wrote

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-16 Thread Jeff Layton
On Fri, 16 Jan 2015 09:31:23 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/15/2015 03:22 PM, Jeff Layton wrote: Ok, I tried to reproduce it with that and several variations but it still doesn't seem to do it for me. Can you try the latest linux-next tree and see if it's still

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-14 Thread Jeff Layton
On Wed, 14 Jan 2015 18:44:41 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/14/2015 09:27 AM, Jeff Layton wrote: On Tue, 13 Jan 2015 17:50:45 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/13/2015 04:44 PM, Jeff Layton wrote: On Tue, 13 Jan 2015 00:11:37 -0500 Sasha

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-14 Thread Jeff Layton
On Tue, 13 Jan 2015 17:50:45 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/13/2015 04:44 PM, Jeff Layton wrote: On Tue, 13 Jan 2015 00:11:37 -0500 Sasha Levin sasha.le...@oracle.com wrote: Hey Jeff, While fuzzing with trinity inside a KVM tools guest running the latest

[PATCH v3 01/13] locks: add new struct list_head to struct file_lock

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com ...that we can use to queue file_locks to per-ctx list_heads. Go ahead and convert locks_delete_lock and locks_dispose_list to use it instead of the fl_block list. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de

[PATCH v3 08/13] locks: remove i_flock field from struct inode

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com Nothing uses it anymore. Also add a forward declaration for struct file_lock to silence some compiler warnings that the removal triggers. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- include/linux/fs.h

[PATCH v3 02/13] locks: have locks_release_file use flock_lock_file to release generic flock locks

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com ...instead of open-coding it and removing flock locks directly. This helps consolidate the flock lock removal logic into a single spot. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 49

[PATCH v3 07/13] locks: convert lease handling to file_lock_context

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs/locks.c | 252 + include/linux/fs.h | 5 +- 2 files changed, 102 insertions(+), 155 deletions

[PATCH v3 09/13] locks: add a dedicated spinlock to protect i_flctx lists

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com We can now add a dedicated spinlock without expanding struct inode. Change to using that to protect the various i_flctx lists. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs/ceph/locks.c | 8

[PATCH v3 12/13] locks: consolidate NULL i_flctx checks in locks_remove_file

2015-01-22 Thread Jeff Layton
We have each of the locks_remove_* variants doing this individually. Have the caller do it instead, and have locks_remove_flock and locks_remove_lease just assume that it's a valid pointer. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 9 +++-- 1 file changed, 7

[PATCH v3 10/13] locks: clean up the lm_change prototype

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com Now that we use standard list_heads for tracking leases, we can have lm_change take a pointer to the lease to be modified instead of a double pointer. Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs

[PATCH v3 00/13] locks: saner method for managing file locks

2015-01-22 Thread Jeff Layton
with that for now. For now, the code is still pretty raw and isn't bisectable. This is just a RFC for the basic approach. This is probably v3.19 material at best. Anyone have thoughts or comments on the basic approach? Jeff Layton (13): locks: add new struct list_head to struct file_lock locks

[PATCH v3 05/13] locks: move flock locks to file_lock_context

2015-01-22 Thread Jeff Layton
From: Jeff Layton jlay...@primarydata.com Signed-off-by: Jeff Layton jlay...@primarydata.com Acked-by: Christoph Hellwig h...@lst.de --- fs/ceph/locks.c | 23 --- fs/locks.c | 54 ++--- fs/nfs/delegation.c | 19

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-21 Thread Jeff Layton
On Wed, 21 Jan 2015 08:25:02 -0500 Sasha Levin sasha.le...@oracle.com wrote: On 01/16/2015 04:16 PM, Jeff Layton wrote: On Fri, 16 Jan 2015 13:53:04 -0500 Jeff Layton jlay...@primarydata.com wrote: On Fri, 16 Jan 2015 13:10:46 -0500 Sasha Levin sasha.le...@oracle.com wrote

[PATCH] locks: fix list insertion when lock is split in two

2015-02-17 Thread Jeff Layton
the new lock. When we add a new lock, set fl to that value so that we can add left before it. Reported-by: Al Viro v...@zeniv.linux.org.uk Signed-off-by: Jeff Layton jeff.lay...@primarydata.com --- fs/locks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/locks.c b/fs/locks.c index

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-16 Thread Jeff Layton
. Linus Thanks for helping sanity check this stuff. -- Jeff Layton jlay...@poochiereds.net -- 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://vger.kernel.org/majordomo-info.html Please read

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-17 Thread Jeff Layton
On Tue, 17 Feb 2015 11:41:40 -0800 Linus Torvalds torva...@linux-foundation.org wrote: On Tue, Feb 17, 2015 at 11:27 AM, Jeff Layton jlay...@poochiereds.net wrote: What about this instead then? No. Really. - leave the drop the spinlock thing in place in flock_lock_file for v3.20

Re: [PATCH 2/4] locks: remove conditional lock release in middle of flock_lock_file

2015-02-17 Thread Jeff Layton
On Tue, 17 Feb 2015 12:10:17 -0500 J. Bruce Fields bfie...@fieldses.org wrote: On Tue, Feb 17, 2015 at 07:46:28AM -0500, Jeff Layton wrote: As Linus pointed out: Say we have an existing flock, and now do a new one that conflicts. I see what looks like three separate bugs

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-17 Thread Jeff Layton
locks associated with the same filp, but that's the way it has worked now for years. I'm leery of changing that behavior in the context of this set. -- Jeff Layton jlay...@poochiereds.net -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH 0/4] locks: flock and lease related bugfixes, and remove i_flctx counters

2015-02-17 Thread Jeff Layton
sections around a read lock I'd say that file locking merge is most likely suspect... Almost certainly. I'll take a look. Thanks, -- Jeff Layton jeff.lay...@primarydata.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org

Re: [RFC v0 1/1] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock

2015-02-19 Thread Jeff Layton
...@zeniv.linux.org.uk Cc: Jeff Layton jlay...@poochiereds.net Cc: J. Bruce Fields bfie...@fieldses.org Cc: John Kacur jka...@redhat.com Cc: linux-fsde...@vger.kernel.org Cc: linux-rt-us...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Thanks for the patch. Some general comments first: - fs

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-16 Thread Jeff Layton
introduce some smaller patches to fix up the bug you spotted, but at least we'll be proceeding from a spot that is known to work. I'll start preparing a pull request that does that... Thanks, -- Jeff Layton jlay...@poochiereds.net -- To unsubscribe from this list: send the line unsubscribe linux

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-16 Thread Jeff Layton
On Mon, 16 Feb 2015 16:21:30 -0800 Linus Torvalds torva...@linux-foundation.org wrote: On Mon, Feb 16, 2015 at 4:02 PM, Jeff Layton jlay...@poochiereds.net wrote: Now that I look, it may be best to just revert this whole set for now. Linus, are you amenable to doing that? Sure. But I'd

Re: [GIT PULL] please pull file-locking related changes for v3.20

2015-02-16 Thread Jeff Layton
On Mon, 16 Feb 2015 15:32:00 +0200 Kirill A. Shutemov kir...@shutemov.name wrote: On Mon, Feb 09, 2015 at 05:55:40AM -0500, Jeff Layton wrote: The following changes since commit cb59670870d90ff8bc31f5f2efc407c6fe4938c0: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux

Re: [GIT PULL] please pull file-locking related changes for v3.20 (pile #2)

2015-02-18 Thread Jeff Layton
.. and they passed. Linus I also ran the LTP suite on it last night and all of the fcntl and flock tests that passed v3.19 also passed with this set (thanks Al for pointing those out!) -- Jeff Layton jlay...@poochiereds.net -- To unsubscribe from this list: send the line

Re: [PATCH 2/4] locks: remove conditional lock release in middle of flock_lock_file

2015-02-17 Thread Jeff Layton
On Tue, 17 Feb 2015 17:21:02 -0500 J. Bruce Fields bfie...@fieldses.org wrote: On Tue, Feb 17, 2015 at 02:11:36PM -0500, J. Bruce Fields wrote: On Tue, Feb 17, 2015 at 12:56:49PM -0500, Jeff Layton wrote: On Tue, 17 Feb 2015 12:10:17 -0500 J. Bruce Fields bfie...@fieldses.org wrote

[GIT PULL] please pull file-locking related changes for v3.20 (pile #2)

2015-02-18 Thread Jeff Layton
of patches to fix problems with the recent file locking changes that we discussed earlier this week. Jeff Layton (4): Revert locks: keep a count of locks on the flctx lists locks: only remove leases associated with the file

[PATCH 1/4] Revert locks: keep a count of locks on the flctx lists

2015-02-17 Thread Jeff Layton
This reverts commit 9bd0f45b7037fcfa8b575c7e27d0431d6e6dc3bb. Linus rightly pointed out that I failed to initialize the counters when adding them, so they don't work as expected. Just revert this patch for now. Reported-by: Linus Torvalds torva...@linux-foundation.org Signed-off-by: Jeff Layton

[PATCH 3/4] locks: when upgrading, don't remove old flock lock until replacing with new one

2015-02-17 Thread Jeff Layton
. If however, there is another LOCK_SH lock on the file, we're out of luck. We've removed our LOCK_SH lock already and can't insert a LOCK_EX lock. Fix this by ensuring that we don't remove any lock that we're replacing until we're sure that we can add its replacement. Signed-off-by: Jeff Layton

[PATCH 4/4] locks: only remove leases associated with the file being closed

2015-02-17 Thread Jeff Layton
We don't want to remove all leases just because one filp was closed. Signed-off-by: Jeff Layton jeff.lay...@primarydata.com --- fs/locks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/locks.c b/fs/locks.c index 59eadd416b8c..c748176fde6a 100644 --- a/fs/locks.c +++ b

[PATCH 2/4] locks: remove conditional lock release in middle of flock_lock_file

2015-02-17 Thread Jeff Layton
one. ...remove the drop the spinlock code in the middle of this function as it has always been suspicious. Reported-by: Linus Torvalds torva...@linux-foundation.org Signed-off-by: Jeff Layton jeff.lay...@primarydata.com --- fs/locks.c | 10 -- 1 file changed, 10 deletions(-) diff --git

[PATCH 0/4] locks: flock and lease related bugfixes, and remove i_flctx counters

2015-02-17 Thread Jeff Layton
18:02:02 -0800) are available in the git repository at: git://git.samba.org/jlayton/linux.git tags/locks-v3.20-2 for you to fetch changes up to c07ef59a2e7f768ec39fb9c93419e27d09698e22: locks: only remove leases associated with the file being closed (2015-02-17 06:59:42 -0500) Jeff

Re: Overlayfs, *notify() and file locking...

2015-01-26 Thread Jeff Layton
not be fabricated from the same set of directories in the same order. David -- Jeff Layton jeff.lay...@primarydata.com -- 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://vger.kernel.org

Re: [PATCH v2 05/17] locks: generic_delete_lease doesn't need a file_lock at all

2015-01-12 Thread Jeff Layton
On Tue, 13 Jan 2015 12:03:43 +1300 NeilBrown ne...@suse.de wrote: On Thu, 4 Sep 2014 08:38:31 -0400 Jeff Layton jlay...@primarydata.com wrote: Ensure that it's OK to pass in a NULL file_lock double pointer on a F_UNLCK request and convert the vfs_setlease F_UNLCK callers to do just

Re: [PATCH] locks: fix NULL-deref in generic_delete_lease

2015-01-13 Thread Jeff Layton
of testing on it today and send it along to Linus in the next day or so. Thanks! -- Jeff Layton jlay...@primarydata.com pgpjsqtSq1MIW.pgp Description: OpenPGP digital signature

Re: fs: locks: WARNING: CPU: 16 PID: 4296 at fs/locks.c:236 locks_free_lock_context+0x10d/0x240()

2015-01-13 Thread Jeff Layton
offhand, but I'll keep looking at it. Just to be clear -- were there any exotic filesystems involved here? In particular any that define a -flock inode operation (e.g. NFS) ? Thanks for the report... -- Jeff Layton jlay...@primarydata.com -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH v2 02/10] locks: have locks_release_file use flock_lock_file to release generic flock locks

2015-01-09 Thread Jeff Layton
On Fri, 9 Jan 2015 06:27:23 -0800 Christoph Hellwig h...@infradead.org wrote: On Thu, Jan 08, 2015 at 10:34:17AM -0800, Jeff Layton wrote: ...instead of open-coding it and removing flock locks directly. This simplifies some coming interim changes in the following patches when we have

Re: [PATCH v2 04/10] locks: move flock locks to file_lock_context

2015-01-09 Thread Jeff Layton
that up for the next iteration. -- Jeff Layton jlay...@primarydata.com -- 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://vger.kernel.org/majordomo-info.html Please read the FAQ at http

[GIT PULL] please pull file-locking related bugfix for v3.19 (and v3.18 stable)

2015-01-14 Thread Jeff Layton
insertion(+), 1 deletion(-) -- Jeff Layton jlay...@poochiereds.net -- 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://vger.kernel.org/majordomo-info.html Please read the FAQ at http

[GIT PULL] please pull file-locking related changes for v3.20

2015-02-09 Thread Jeff Layton
it may be easiest to pull this in early. Jeff Layton (13): locks: add new struct list_head to struct file_lock locks: have locks_release_file use flock_lock_file to release generic flock locks locks: add a new struct

[PATCH v2 01/10] locks: add new struct list_head to struct file_lock

2015-01-08 Thread Jeff Layton
...that we can use to queue file_locks to per-ctx list_heads. Go ahead and convert locks_delete_lock and locks_dispose_list to use it instead of the fl_block list. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 8 +--- include/linux/fs.h | 1 + 2 files changed, 6

[PATCH v2 09/10] locks: clean up the lm_change prototype

2015-01-08 Thread Jeff Layton
Now that we use standard list_heads for tracking leases, we can have lm_change take a pointer to the lease to be modified instead of a double pointer. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 13 ++--- fs/nfsd/nfs4state.c | 2 +- include/linux/fs.h

[PATCH v2 05/10] locks: convert posix locks to file_lock_context

2015-01-08 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/ceph/locks.c | 58 +--- fs/cifs/file.c | 26 + fs/lockd/svcsubs.c | 20 ++ fs/locks.c | 108 +++- fs/nfs/delegation.c | 27

[PATCH v2 03/10] locks: add a new struct file_locking_context pointer to struct inode

2015-01-08 Thread Jeff Layton
is added to it, and it's only freed when the inode is freed. Assignment of the pointer is done without locking using a compare and swap operation. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/inode.c | 3 ++- fs/locks.c | 37

[PATCH v2 06/10] locks: convert lease handling to file_lock_context

2015-01-08 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 251 + include/linux/fs.h | 5 +- 2 files changed, 101 insertions(+), 155 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index fadf50297e5c..acfad02bc136 100644

[PATCH v2 08/10] locks: add a dedicated spinlock to protect i_flctx lists

2015-01-08 Thread Jeff Layton
We can now add a dedicated spinlock without expanding struct inode. Change to using that to protect the various i_flctx lists. We do still use the i_lock to protect the i_flctx pointer itself, but once the context is assigned to the inode we no longer need it. Signed-off-by: Jeff Layton jlay

[PATCH v2 10/10] locks: keep a count of locks on the flctx lists

2015-01-08 Thread Jeff Layton
This makes things a bit more efficient in the cifs and ceph lock pushing code. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/ceph/locks.c| 11 ++- fs/cifs/file.c | 14 -- fs/locks.c | 38 ++ include/linux/fs.h

[PATCH v2 07/10] locks: remove i_flock field from struct inode

2015-01-08 Thread Jeff Layton
Nothing uses it anymore. Also add a forward declaration for struct file_lock to silence some compiler warnings that the removal triggers. Signed-off-by: Jeff Layton jlay...@primarydata.com --- include/linux/fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux

[PATCH v2 04/10] locks: move flock locks to file_lock_context

2015-01-08 Thread Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/ceph/locks.c | 28 --- fs/ceph/mds_client.c | 4 fs/locks.c | 53 +--- fs/nfs/delegation.c | 18 -- fs/nfs/nfs4state.c | 42

[PATCH v2 02/10] locks: have locks_release_file use flock_lock_file to release generic flock locks

2015-01-08 Thread Jeff Layton
...instead of open-coding it and removing flock locks directly. This simplifies some coming interim changes in the following patches when we have different file_lock types protected by different spinlocks. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 49

[PATCH v2 00/10] locks: saner method for managing file locks

2015-01-08 Thread Jeff Layton
Jeff Layton (10): locks: add new struct list_head to struct file_lock locks: have locks_release_file use flock_lock_file to release generic flock locks locks: add a new struct file_locking_context pointer to struct inode locks: move flock locks to file_lock_context locks: convert posix

[GIT PULL] please pull file-locking related change for v4.0 (#3)

2015-03-06 Thread Jeff Layton
(#3) Just a single patch to fix a memory leak that Daniel Wagner discovered while doing some testing with leases. Jeff Layton (1): locks: fix fasync_struct memory leak in lease upgrade/downgrade handling fs/locks.c | 3 ++- 1

Re: [PATCH v3 0/2] Use blocked_lock_lock only to protect blocked_hash

2015-03-07 Thread Jeff Layton
of __locks_insert/delete_block() and it's posix version - added seqfile helpers to avoid ugly open coded version https://lkml.org/lkml/2015/3/2/351 Cc: Alexander Viro v...@zeniv.linux.org.uk Cc: Jeff Layton jlay...@poochiereds.net Cc: J. Bruce Fields bfie...@fieldses.org Cc: linux-fsde

Re: [PATCH v3 0/2] Use blocked_lock_lock only to protect blocked_hash

2015-03-07 Thread Jeff Layton
On Sat, 7 Mar 2015 09:00:41 -0500 Jeff Layton jlay...@poochiereds.net wrote: On Fri, 6 Mar 2015 08:53:30 +0100 Daniel Wagner daniel.wag...@bmw-carit.de wrote: Hi, Finally, I got a bigger machine and did a quick test round. I expected to see some improvements but the resutls do

[PATCH 3/4] locks: get rid of WE_CAN_BREAK_LSLK_NOW dead code

2015-03-07 Thread Jeff Layton
with the legacy format. Signed-off-by: Jeff Layton jeff.lay...@primarydata.com --- fs/locks.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 49d240874d4e..4347f3dc17cc 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2565,15 +2565,10 @@ static

[PATCH 1/4] locks: don't allocate a lock context for an F_UNLCK request

2015-03-07 Thread Jeff Layton
NULL. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 0915a3ead897..7be49ad1c902 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -203,11 +203,11 @@ static struct

[PATCH 0/4] locks: locks related cleanups for v4.1

2015-03-07 Thread Jeff Layton
the i_flctx field used cmpxchg to assign it, but I ended up taking that out due to a problem that Sasha Levin reported. I now think that I misunderstood the problem and that using cmpxchg for that should be ok. Jeff Layton (4): locks: don't allocate a lock context for an F_UNLCK request locks

[PATCH 4/4] locks: use cmpxchg to assign i_flctx pointer

2015-03-07 Thread Jeff Layton
of flock_lock_file, you could end up with multiple flock locks for the same struct file on the inode. Reinstate the use of a CAS operation to assign this pointer since it's likely to be more efficient and gets the i_lock completely out of the file locking business. Signed-off-by: Jeff Layton jeff.lay

[PATCH 2/4] locks: change lm_get_owner and lm_put_owner prototypes

2015-03-07 Thread Jeff Layton
the callers deal with assigning the values to the file_lock structs. Signed-off-by: Jeff Layton jlay...@primarydata.com --- fs/locks.c | 8 +--- fs/nfsd/nfs4state.c | 18 ++ include/linux/fs.h | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git

Re: [PATCH] proc: show locks in /proc/pid/fdinfo/X

2015-03-07 Thread Jeff Layton
...@zeniv.linux.org.uk Cc: Jeff Layton jlay...@poochiereds.net Cc: J. Bruce Fields bfie...@fieldses.org Cc: Andrew Morton a...@linux-foundation.org Cc: Cyrill Gorcunov gorcu...@openvz.org Cc: Pavel Emelyanov xe...@parallels.com Signed-off-by: Andrey Vagin ava...@openvz.org

[PATCH] locks: fix generic_delete_lease tracepoint to use victim pointer

2015-03-07 Thread Jeff Layton
It's possible that fl won't point at a valid lock at this point, so have it instead point at victim which is either a valid lock or NULL. Signed-off-by: Jeff Layton jeff.lay...@primarydata.com --- fs/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/locks.c b/fs

<    7   8   9   10   11   12   13   14   15   16   >