[PATCH 07/12] fs/locks: allow a lock request to block other requests.

2018-11-29 Thread NeilBrown
is requeued or discarded, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Tested-by: kernel test robot Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/lock

[PATCH 06/12] fs/locks: use properly initialized file_lock when unlocking.

2018-11-29 Thread NeilBrown
using flock_make_lock(), and changing it to allow a file_lock to be passed in, so memory allocation isn't always needed. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fs

[PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-29 Thread NeilBrown
-and-tested-by: Martin Wilck Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 69 +++- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 91fc29912151..7a55d6feb12a 100644 --- a/fs

[PATCH 11/12] fs/locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-29 Thread NeilBrown
. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/cifs/file.c |2 +- fs/lockd/svclock.c |2 +- fs/locks.c | 36 +--- fs/nfsd/nfs4state.c |6 +++--- include/linux/fs.h |4 ++-- 5 files changed, 20 insertions(+), 30 deletions

[PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-29 Thread NeilBrown
-and-tested-by: Martin Wilck Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 69 +++- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 91fc29912151..7a55d6feb12a 100644 --- a/fs

[PATCH 11/12] fs/locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-29 Thread NeilBrown
. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/cifs/file.c |2 +- fs/lockd/svclock.c |2 +- fs/locks.c | 36 +--- fs/nfsd/nfs4state.c |6 +++--- include/linux/fs.h |4 ++-- 5 files changed, 20 insertions(+), 30 deletions

[PATCH 12/12] fs/locks: remove unnecessary white space.

2018-11-29 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff

[PATCH 12/12] fs/locks: remove unnecessary white space.

2018-11-29 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-29 Thread NeilBrown
to the new lock, though when merged with a pre-exiting lock, this might not happen. In all cases we don't want blocked locks to remain attached, so we remove them to be safe. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Tested-by: syzbot+a4a3d526b4157113e...@syzkaller.appspotmail.com Tested

[PATCH 05/12] ocfs2: properly initial file_lock used for unlock.

2018-11-29 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields

[PATCH 03/12] NFS: use locks_copy_lock() to copy locks.

2018-11-29 Thread NeilBrown
-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/nfs/nfs4proc.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 867457d6dfbe..0ba2b0fb8ff3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6311,7 +6311,8 @@ static

[PATCH 04/12] gfs2: properly initial file_lock used for unlock.

2018-11-29 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields

[PATCH 09/12] fs/locks: change all *_conflict() functions to return bool.

2018-11-29 Thread NeilBrown
. And convert some return (foo); to return foo; Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 2814662ecfe6..91fc29912151 100644 --- a/fs/locks.c

[PATCH 03/12] NFS: use locks_copy_lock() to copy locks.

2018-11-29 Thread NeilBrown
-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/nfs/nfs4proc.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 867457d6dfbe..0ba2b0fb8ff3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6311,7 +6311,8 @@ static

[PATCH 04/12] gfs2: properly initial file_lock used for unlock.

2018-11-29 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields

[PATCH 09/12] fs/locks: change all *_conflict() functions to return bool.

2018-11-29 Thread NeilBrown
. And convert some return (foo); to return foo; Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 2814662ecfe6..91fc29912151 100644 --- a/fs/locks.c

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-29 Thread NeilBrown
to the new lock, though when merged with a pre-exiting lock, this might not happen. In all cases we don't want blocked locks to remain attached, so we remove them to be safe. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Tested-by: syzbot+a4a3d526b4157113e...@syzkaller.appspotmail.com Tested

[PATCH 05/12] ocfs2: properly initial file_lock used for unlock.

2018-11-29 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields

[PATCH 02/12] fs/locks: split out __locks_wake_up_blocks().

2018-11-29 Thread NeilBrown
This functionality will be useful in future patches, so split it out from locks_wake_up_blocks(). Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/locks.c b/fs/locks.c

[PATCH 02/12] fs/locks: split out __locks_wake_up_blocks().

2018-11-29 Thread NeilBrown
This functionality will be useful in future patches, so split it out from locks_wake_up_blocks(). Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/locks.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/locks.c b/fs/locks.c

[PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-29 Thread NeilBrown
that a tracepoint is changed to report fl_blocker instead of fl_next. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/cifs/file.c |2 + fs/locks.c | 59 --- include/linux/fs.h |9 +- include

[PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-29 Thread NeilBrown
that a tracepoint is changed to report fl_blocker instead of fl_next. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields --- fs/cifs/file.c |2 + fs/locks.c | 59 --- include/linux/fs.h |9 +- include

[PATCH 00/12 v6] fs/locks: avoid thundering-herd wake-ups

2018-11-29 Thread NeilBrown
This series has the fixes for the recently reported performance regressions merged into the patches which caused them. It also has a couple of little fixes that have been mentioned on the list, and that Jeff had merged into his copy. Thanks, NeilBrown --- NeilBrown (12): fs/locks: rename

[PATCH 00/12 v6] fs/locks: avoid thundering-herd wake-ups

2018-11-29 Thread NeilBrown
This series has the fixes for the recently reported performance regressions merged into the patches which caused them. It also has a couple of little fixes that have been mentioned on the list, and that Jeff had merged into his copy. Thanks, NeilBrown --- NeilBrown (12): fs/locks: rename

Re: [PATCH 02/25] iov_iter: Use accessor function [ver #2]

2018-11-27 Thread NeilBrown
but as there are no users it is probably best to discard it. I discovered this because lustre uses (or rather "used") it. NeilBrown From: NeilBrown Date: Wed, 28 Nov 2018 12:38:30 +1100 Subject: [PATCH] iov_iter: discard iov_for_each() iov_for_each has no users and cannot compile as

Re: [PATCH 02/25] iov_iter: Use accessor function [ver #2]

2018-11-27 Thread NeilBrown
but as there are no users it is probably best to discard it. I discovered this because lustre uses (or rather "used") it. NeilBrown From: NeilBrown Date: Wed, 28 Nov 2018 12:38:30 +1100 Subject: [PATCH] iov_iter: discard iov_for_each() iov_for_each has no users and cannot compile as

[PATCH] locks: fix performance regressions.

2018-11-27 Thread NeilBrown
The kernel test robot reported two performance regressions caused by recent patches. Both appear to related to the global spinlock blocked_lock_lock being taken more often. This patch avoids taking that lock in the cases tested. Reported-by: kernel test robot Signed-off-by: NeilBrown --- Hi

[PATCH] locks: fix performance regressions.

2018-11-27 Thread NeilBrown
The kernel test robot reported two performance regressions caused by recent patches. Both appear to related to the global spinlock blocked_lock_lock being taken more often. This patch avoids taking that lock in the cases tested. Reported-by: kernel test robot Signed-off-by: NeilBrown --- Hi

Re: [LKP] [fs/locks] 83b381078b: will-it-scale.per_thread_ops -62.5% regression

2018-11-27 Thread NeilBrown
king a file that is only used > by that thread. Thanks for identifying that Bruce. This would certainly be a case where locks_delete_block() is now being called when it wasn't before. > > By the way, what's the X-axis on these graphs? (Or the y-axi

Re: [LKP] [fs/locks] 83b381078b: will-it-scale.per_thread_ops -62.5% regression

2018-11-27 Thread NeilBrown
king a file that is only used > by that thread. Thanks for identifying that Bruce. This would certainly be a case where locks_delete_block() is now being called when it wasn't before. > > By the way, what's the X-axis on these graphs? (Or the y-axi

Re: [PATCH] staging: greybus: Parenthesis alignment

2018-11-20 Thread NeilBrown
o_apbridgea_register_cport( data->connection, i2s_port, cportid, AUDIO_APBRIDGEA_DIRECTION_TX); but checkpatch doesn't like the '(' at the end of the line. Do you know why that is? Thanks, NeilBrown > > But if you are going to do this for multiple li

Re: [PATCH] staging: greybus: Parenthesis alignment

2018-11-20 Thread NeilBrown
o_apbridgea_register_cport( data->connection, i2s_port, cportid, AUDIO_APBRIDGEA_DIRECTION_TX); but checkpatch doesn't like the '(' at the end of the line. Do you know why that is? Thanks, NeilBrown > > But if you are going to do this for multiple li

Re: [PATCH v6 1/3] staging: mt7621-mmc: Remove #if 0 blocks in sd.c

2018-11-17 Thread NeilBrown
nd the "#endif /* end of --- */" at the end? Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH v6 1/3] staging: mt7621-mmc: Remove #if 0 blocks in sd.c

2018-11-17 Thread NeilBrown
nd the "#endif /* end of --- */" at the end? Thanks, NeilBrown signature.asc Description: PGP signature

Re: KASAN: use-after-free Read in locks_delete_block

2018-11-15 Thread NeilBrown
On Thu, Nov 15 2018, Dmitry Vyukov wrote: > On Wed, Nov 14, 2018 at 2:36 AM, Jeff Layton wrote: >> On Wed, 2018-11-14 at 07:40 +1100, NeilBrown wrote: >>> On Tue, Nov 13 2018, Jeff Layton wrote: >>> >>> > On Mon, 2018-11-12 at 12:34 -0800, syzbot wrote

Re: KASAN: use-after-free Read in locks_delete_block

2018-11-15 Thread NeilBrown
On Thu, Nov 15 2018, Dmitry Vyukov wrote: > On Wed, Nov 14, 2018 at 2:36 AM, Jeff Layton wrote: >> On Wed, 2018-11-14 at 07:40 +1100, NeilBrown wrote: >>> On Tue, Nov 13 2018, Jeff Layton wrote: >>> >>> > On Mon, 2018-11-12 at 12:34 -0800, syzbot wrote

Re: KASAN: use-after-free Read in locks_delete_block

2018-11-13 Thread NeilBrown
down in the mandatory locking code. This is with Neil's set > from last week. I haven't merged the series he sent the other day yet, > but they don't seem to be different in this regard. > > Looks like the fl_blocked list might have had an entry on it that was > freed without being rem

Re: KASAN: use-after-free Read in locks_delete_block

2018-11-13 Thread NeilBrown
down in the mandatory locking code. This is with Neil's set > from last week. I haven't merged the series he sent the other day yet, > but they don't seem to be different in this regard. > > Looks like the fl_blocked list might have had an entry on it that was > freed without being rem

[PATCH 12/12] VFS: locks: remove unnecessary white space.

2018-11-11 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/fs/locks.c b/fs

[PATCH 12/12] VFS: locks: remove unnecessary white space.

2018-11-11 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/fs/locks.c b/fs

[PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-11 Thread NeilBrown
-and-tested-by: Martin Wilck Signed-off-by: NeilBrown --- fs/locks.c | 69 +++- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 74b24191d6e6..1006b566ddf5 100644 --- a/fs/locks.c +++ b/fs/locks.c

[PATCH 11/12] locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-11 Thread NeilBrown
. Signed-off-by: NeilBrown --- fs/cifs/file.c |2 +- fs/lockd/svclock.c |2 +- fs/locks.c | 36 +--- fs/nfsd/nfs4state.c |6 +++--- include/linux/fs.h |4 ++-- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/fs/cifs/file.c

[PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-11 Thread NeilBrown
-and-tested-by: Martin Wilck Signed-off-by: NeilBrown --- fs/locks.c | 69 +++- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 74b24191d6e6..1006b566ddf5 100644 --- a/fs/locks.c +++ b/fs/locks.c

[PATCH 11/12] locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-11 Thread NeilBrown
. Signed-off-by: NeilBrown --- fs/cifs/file.c |2 +- fs/lockd/svclock.c |2 +- fs/locks.c | 36 +--- fs/nfsd/nfs4state.c |6 +++--- include/linux/fs.h |4 ++-- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/fs/cifs/file.c

[PATCH 07/12] fs/locks: allow a lock request to block other requests.

2018-11-11 Thread NeilBrown
is requeued or discarded, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Signed-off-by: NeilBrown --- fs/locks.c | 36 ++-- 1 file changed,

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-11 Thread NeilBrown
to the new lock, though when merged with a pre-exiting lock, this might not happen. In all cases we don't want blocked locks to remain attached, so we remove them to be safe. Signed-off-by: NeilBrown --- fs/locks.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions

[PATCH 09/12] fs/locks: change all *_conflict() functions to return bool.

2018-11-11 Thread NeilBrown
. And convert some return (foo); to return foo; Signed-off-by: NeilBrown --- fs/locks.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 8d9d79e7a565..74b24191d6e6 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -795,47

[PATCH 07/12] fs/locks: allow a lock request to block other requests.

2018-11-11 Thread NeilBrown
is requeued or discarded, all blocked requests are woken. - When deadlock-detection looks for the lock which blocks a given request, we follow the chain of ->fl_blocker all the way to the top. Signed-off-by: NeilBrown --- fs/locks.c | 36 ++-- 1 file changed,

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-11 Thread NeilBrown
to the new lock, though when merged with a pre-exiting lock, this might not happen. In all cases we don't want blocked locks to remain attached, so we remove them to be safe. Signed-off-by: NeilBrown --- fs/locks.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions

[PATCH 09/12] fs/locks: change all *_conflict() functions to return bool.

2018-11-11 Thread NeilBrown
. And convert some return (foo); to return foo; Signed-off-by: NeilBrown --- fs/locks.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 8d9d79e7a565..74b24191d6e6 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -795,47

[PATCH 00/12 v5] locks: avoid thundering-herd wake-ups

2018-11-11 Thread NeilBrown
e - I made a few little changes - flock_make_lock() now properly initialized a lock - using the code from Jeff - code actually compiles for ocfs2 and gfs2 Thanks, NeilBrown --- NeilBrown (12): fs/locks: rename some lists and pointers. fs/locks: split out __locks_wake

[PATCH 00/12 v5] locks: avoid thundering-herd wake-ups

2018-11-11 Thread NeilBrown
e - I made a few little changes - flock_make_lock() now properly initialized a lock - using the code from Jeff - code actually compiles for ocfs2 and gfs2 Thanks, NeilBrown --- NeilBrown (12): fs/locks: rename some lists and pointers. fs/locks: split out __locks_wake

[PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-11 Thread NeilBrown
that a tracepoint is changed to report fl_blocker instead of fl_next. Signed-off-by: NeilBrown --- fs/cifs/file.c |2 + fs/locks.c | 59 --- include/linux/fs.h |9 +- include/trace/events/filelock.h | 16

[PATCH 06/12] locks: use properly initialized file_lock when unlocking.

2018-11-11 Thread NeilBrown
using flock_make_lock(), and changing it to allow a file_lock to be passed in, so memory allocation isn't always needed. Signed-off-by: NeilBrown --- fs/locks.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index

[PATCH 03/12] NFS: use locks_copy_lock() to copy locks.

2018-11-11 Thread NeilBrown
-by: NeilBrown --- fs/nfs/nfs4proc.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 867457d6dfbe..0ba2b0fb8ff3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6311,7 +6311,8 @@ static struct nfs4_unlockdata

[PATCH 05/12] ocfs2: properly initial file_lock used for unlock.

2018-11-11 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown --- fs/ocfs2/locks.c | 10

[PATCH 04/12] gfs2: properly initial file_lock used for unlock.

2018-11-11 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown --- fs/gfs2/file.c | 10

[PATCH 02/12] fs/locks: split out __locks_wake_up_blocks().

2018-11-11 Thread NeilBrown
This functionality will be useful in future patches, so split it out from locks_wake_up_blocks(). Signed-off-by: NeilBrown --- fs/locks.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index c6df0c8b3d13..6adb22a21a92

[PATCH 03/12] NFS: use locks_copy_lock() to copy locks.

2018-11-11 Thread NeilBrown
-by: NeilBrown --- fs/nfs/nfs4proc.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 867457d6dfbe..0ba2b0fb8ff3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6311,7 +6311,8 @@ static struct nfs4_unlockdata

[PATCH 05/12] ocfs2: properly initial file_lock used for unlock.

2018-11-11 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown --- fs/ocfs2/locks.c | 10

[PATCH 04/12] gfs2: properly initial file_lock used for unlock.

2018-11-11 Thread NeilBrown
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NeilBrown --- fs/gfs2/file.c | 10

[PATCH 02/12] fs/locks: split out __locks_wake_up_blocks().

2018-11-11 Thread NeilBrown
This functionality will be useful in future patches, so split it out from locks_wake_up_blocks(). Signed-off-by: NeilBrown --- fs/locks.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index c6df0c8b3d13..6adb22a21a92

[PATCH 06/12] locks: use properly initialized file_lock when unlocking.

2018-11-11 Thread NeilBrown
using flock_make_lock(), and changing it to allow a file_lock to be passed in, so memory allocation isn't always needed. Signed-off-by: NeilBrown --- fs/locks.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index

[PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-11 Thread NeilBrown
that a tracepoint is changed to report fl_blocker instead of fl_next. Signed-off-by: NeilBrown --- fs/cifs/file.c |2 + fs/locks.c | 59 --- include/linux/fs.h |9 +- include/trace/events/filelock.h | 16

Re: [PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Fri, Nov 09, 2018 at 11:38:19AM +1100, NeilBrown wrote: >> On Thu, Nov 08 2018, J. Bruce Fields wrote: >> >> > On Mon, Nov 05, 2018 at 12:30:48PM +1100, NeilBrown wrote: >> >> When we find an existing

Re: [PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Fri, Nov 09, 2018 at 11:38:19AM +1100, NeilBrown wrote: >> On Thu, Nov 08 2018, J. Bruce Fields wrote: >> >> > On Mon, Nov 05, 2018 at 12:30:48PM +1100, NeilBrown wrote: >> >> When we find an existing

Re: [PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-08 Thread NeilBrown
that's an argument in favor of building creds on demand > rather than keeping them in a hash table, isn't it. :-) I think it is. Thanks!!! NeilBrown > > >>> In addition, the comment near unx_marshal suggests we should >>> cache the marshaled on-the-wire vers

Re: [PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-08 Thread NeilBrown
that's an argument in favor of building creds on demand > rather than keeping them in a hash table, isn't it. :-) I think it is. Thanks!!! NeilBrown > > >>> In addition, the comment near unx_marshal suggests we should >>> cache the marshaled on-the-wire vers

Re: [PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Mon, Nov 05, 2018 at 12:30:48PM +1100, NeilBrown wrote: >> When we find an existing lock which conflicts with a request, >> and the request wants to wait, we currently add the request >> to a list. When the lock is removed, th

Re: [PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Mon, Nov 05, 2018 at 12:30:48PM +1100, NeilBrown wrote: >> When we find an existing lock which conflicts with a request, >> and the request wants to wait, we currently add the request >> to a list. When the lock is removed, th

Re: [PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Mon, Nov 05, 2018 at 12:30:47PM +1100, NeilBrown wrote: >> struct file lock contains an 'fl_next' pointer which >> is used to point to the lock that this request is blocked >> waiting for. So rename it to fl_blocker.

Re: [PATCH 01/12] fs/locks: rename some lists and pointers.

2018-11-08 Thread NeilBrown
On Thu, Nov 08 2018, J. Bruce Fields wrote: > On Mon, Nov 05, 2018 at 12:30:47PM +1100, NeilBrown wrote: >> struct file lock contains an 'fl_next' pointer which >> is used to point to the lock that this request is blocked >> waiting for. So rename it to fl_blocker.

Re: [PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-07 Thread NeilBrown
On Wed, Nov 07 2018, Chuck Lever wrote: > Hi Neil- > > >> On Nov 6, 2018, at 11:12 PM, NeilBrown wrote: >> >> 1/ discard 'struct unx_cred'. We don't need any data that >> is not already in 'struct rpc_cred'. >> 2/ Don't keep these creds in a hash t

Re: [PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-07 Thread NeilBrown
On Wed, Nov 07 2018, Chuck Lever wrote: > Hi Neil- > > >> On Nov 6, 2018, at 11:12 PM, NeilBrown wrote: >> >> 1/ discard 'struct unx_cred'. We don't need any data that >> is not already in 'struct rpc_cred'. >> 2/ Don't keep these creds in a hash t

Re: [LKP] [locks] dee160df82: BUG:KASAN:null-ptr-deref_in_l

2018-11-07 Thread NeilBrown
_after_hwframe+0x49/0xbe >> > > [ 42.063639] RIP: 0033:0x7f31c39fe250 >> > > [ 42.064798] Code: 73 01 c3 48 8b 0d 58 7d 20 00 f7 d8 64 89 01 48 83 >> > > c8 ff c3 66 0f 1f 44 00 00 83 3d 79 c1 20 00 00 75 10 b8 03 00 00 00 0f >> > > 05 <48&

Re: [LKP] [locks] dee160df82: BUG:KASAN:null-ptr-deref_in_l

2018-11-07 Thread NeilBrown
_after_hwframe+0x49/0xbe >> > > [ 42.063639] RIP: 0033:0x7f31c39fe250 >> > > [ 42.064798] Code: 73 01 c3 48 8b 0d 58 7d 20 00 f7 d8 64 89 01 48 83 >> > > c8 ff c3 66 0f 1f 44 00 00 83 3d 79 c1 20 00 00 75 10 b8 03 00 00 00 0f >> > > 05 <48&

[PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-06 Thread NeilBrown
table. As the lookup can happen during write-out, use a mempool to ensure forward progress. This means that we cannot compare two credentials for equality by comparing the pointers, but we never do that anyway. Signed-off-by: NeilBrown --- net/sunrpc/auth.c |1 net/sunrpc

[PATCH 21/23] SUNRPC: remove crbind rpc_cred operation

2018-11-06 Thread NeilBrown
This now always just does get_rpccred(), so we don't need an operation pointer to know to do that. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|2 -- net/sunrpc/auth.c | 12 +--- net/sunrpc/auth_gss/auth_gss.c |2 -- net/sunrpc/auth_null.c

[PATCH 19/23] NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'.

2018-11-06 Thread NeilBrown
which is statically allocated and recognized where needed as having a special meaning. A look-up of a low-level cred will map this to a machine credential. Signed-off-by: NeilBrown --- fs/lockd/clntproc.c |6 + fs/nfs/blocklayout/blocklayout.c |2

[PATCH 23/23] SUNRPC discard cr_uid from struct rpc_cred.

2018-11-06 Thread NeilBrown
Just use ->cr_cred->fsuid directly. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|2 -- net/sunrpc/auth.c |1 - net/sunrpc/auth_gss/auth_gss.c | 12 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/linux/sunrpc/au

[PATCH 20/23] SUNRPC: remove generic cred code.

2018-11-06 Thread NeilBrown
This is no longer used. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h |6 - net/sunrpc/Makefile |2 net/sunrpc/auth.c | 18 net/sunrpc/auth_generic.c | 199 --- net/sunrpc/auth_null.c |2 5 files

[PATCH 22/23] SUNRPC: simplify auth_unix.

2018-11-06 Thread NeilBrown
table. As the lookup can happen during write-out, use a mempool to ensure forward progress. This means that we cannot compare two credentials for equality by comparing the pointers, but we never do that anyway. Signed-off-by: NeilBrown --- net/sunrpc/auth.c |1 net/sunrpc

[PATCH 21/23] SUNRPC: remove crbind rpc_cred operation

2018-11-06 Thread NeilBrown
This now always just does get_rpccred(), so we don't need an operation pointer to know to do that. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|2 -- net/sunrpc/auth.c | 12 +--- net/sunrpc/auth_gss/auth_gss.c |2 -- net/sunrpc/auth_null.c

[PATCH 19/23] NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'.

2018-11-06 Thread NeilBrown
which is statically allocated and recognized where needed as having a special meaning. A look-up of a low-level cred will map this to a machine credential. Signed-off-by: NeilBrown --- fs/lockd/clntproc.c |6 + fs/nfs/blocklayout/blocklayout.c |2

[PATCH 23/23] SUNRPC discard cr_uid from struct rpc_cred.

2018-11-06 Thread NeilBrown
Just use ->cr_cred->fsuid directly. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|2 -- net/sunrpc/auth.c |1 - net/sunrpc/auth_gss/auth_gss.c | 12 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/linux/sunrpc/au

[PATCH 20/23] SUNRPC: remove generic cred code.

2018-11-06 Thread NeilBrown
This is no longer used. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h |6 - net/sunrpc/Makefile |2 net/sunrpc/auth.c | 18 net/sunrpc/auth_generic.c | 199 --- net/sunrpc/auth_null.c |2 5 files

[PATCH 14/23] SUNRPC: add side channel to use non-generic cred for rpc call.

2018-11-06 Thread NeilBrown
ave rpcauth_bindcred() notice it and bind it in place. Credit to kernel test robot for finding a bug in earlier version of this patch. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |2 ++ net/sunrpc/auth.c|6 +- net/sunrpc/clnt.c|2 +-

[PATCH 12/23] NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred().

2018-11-06 Thread NeilBrown
ic 'struct rpc_cred' pointer is used. rpcauth_bindcred() recognizes this, finds the principal from the client, and binds the correct credential. Signed-off-by: NeilBrown --- fs/nfs/client.c | 11 ++- fs/nfs/nfs4_fs.h|9 + fs/nfs/nfs4state.c

[PATCH 17/23] NFS: change access cache to use 'struct cred'.

2018-11-06 Thread NeilBrown
cache is large. This also keeps many fewer items pinned in the rpc cred cache, so the cred cache is less likely to get large. Signed-off-by: NeilBrown --- fs/nfs/dir.c | 44 +++- fs/nfs/nfs3proc.c |9 - fs/nfs/nfs4proc.c

[PATCH 16/23] SUNRPC: remove RPCAUTH_AUTH_NO_CRKEY_TIMEOUT

2018-11-06 Thread NeilBrown
This is no longer used. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h |3 --- net/sunrpc/auth_null.c |1 - net/sunrpc/auth_unix.c |1 - 3 files changed, 5 deletions(-) diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 0bdc2f4957ff

[PATCH 15/23] NFS: move credential expiry tracking out of SUNRPC into NFS.

2018-11-06 Thread NeilBrown
. Signed-off-by: NeilBrown --- fs/nfs/inode.c |2 + fs/nfs/write.c | 24 +++-- include/linux/nfs_fs.h |1 + include/linux/sunrpc/auth.h| 12 -- net/sunrpc/auth.c | 23 net/sunrpc/auth_generic.c | 75

[PATCH 14/23] SUNRPC: add side channel to use non-generic cred for rpc call.

2018-11-06 Thread NeilBrown
ave rpcauth_bindcred() notice it and bind it in place. Credit to kernel test robot for finding a bug in earlier version of this patch. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |2 ++ net/sunrpc/auth.c|6 +- net/sunrpc/clnt.c|2 +-

[PATCH 12/23] NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred().

2018-11-06 Thread NeilBrown
ic 'struct rpc_cred' pointer is used. rpcauth_bindcred() recognizes this, finds the principal from the client, and binds the correct credential. Signed-off-by: NeilBrown --- fs/nfs/client.c | 11 ++- fs/nfs/nfs4_fs.h|9 + fs/nfs/nfs4state.c

[PATCH 17/23] NFS: change access cache to use 'struct cred'.

2018-11-06 Thread NeilBrown
cache is large. This also keeps many fewer items pinned in the rpc cred cache, so the cred cache is less likely to get large. Signed-off-by: NeilBrown --- fs/nfs/dir.c | 44 +++- fs/nfs/nfs3proc.c |9 - fs/nfs/nfs4proc.c

[PATCH 16/23] SUNRPC: remove RPCAUTH_AUTH_NO_CRKEY_TIMEOUT

2018-11-06 Thread NeilBrown
This is no longer used. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h |3 --- net/sunrpc/auth_null.c |1 - net/sunrpc/auth_unix.c |1 - 3 files changed, 5 deletions(-) diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 0bdc2f4957ff

[PATCH 15/23] NFS: move credential expiry tracking out of SUNRPC into NFS.

2018-11-06 Thread NeilBrown
. Signed-off-by: NeilBrown --- fs/nfs/inode.c |2 + fs/nfs/write.c | 24 +++-- include/linux/nfs_fs.h |1 + include/linux/sunrpc/auth.h| 12 -- net/sunrpc/auth.c | 23 net/sunrpc/auth_generic.c | 75

[PATCH 18/23] NFS: struct nfs_open_dir_context: convert rpc_cred pointer to cred.

2018-11-06 Thread NeilBrown
Use the common 'struct cred' to pass credentials for readdir. Signed-off-by: NeilBrown --- fs/nfs/dir.c| 15 +-- fs/nfs/nfs3proc.c | 11 +-- fs/nfs/nfs4proc.c | 13 ++--- fs/nfs/proc.c | 11 +-- include/linux/nfs_fs.h

[PATCH 13/23] SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none

2018-11-06 Thread NeilBrown
LL and set a task flag, similar to RPC_TASK_ROOTCREDS, which requests that NULL credentials be used by default. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |1 + net/sunrpc/auth.c|2 ++ net/sunrpc/clnt.c| 19 ++- 3 files changed, 9

[PATCH 18/23] NFS: struct nfs_open_dir_context: convert rpc_cred pointer to cred.

2018-11-06 Thread NeilBrown
Use the common 'struct cred' to pass credentials for readdir. Signed-off-by: NeilBrown --- fs/nfs/dir.c| 15 +-- fs/nfs/nfs3proc.c | 11 +-- fs/nfs/nfs4proc.c | 13 ++--- fs/nfs/proc.c | 11 +-- include/linux/nfs_fs.h

[PATCH 13/23] SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none

2018-11-06 Thread NeilBrown
LL and set a task flag, similar to RPC_TASK_ROOTCREDS, which requests that NULL credentials be used by default. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |1 + net/sunrpc/auth.c|2 ++ net/sunrpc/clnt.c| 19 ++- 3 files changed, 9

<    1   2   3   4   5   6   7   8   9   10   >