Re: [PATCH v2] staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.c

2018-12-06 Thread NeilBrown
; That causes an error - MSDC_CLKSRC_REG is not defined. > > This patch completely removes the #if 0 block > > Reported-by: NeilBrown > Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") > Signed-off-by: Nishad Kamdar > --- Perfect, thanks.

Re: [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c

2018-12-05 Thread NeilBrown
introduced a problem, it is best-practice to also do $ git fx 2a54e3259e2a Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") and add the "Fixes" near the Signed-off-by line. Thanks, NeilBrown > This causes the function msdc_select_clksrc()

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

2018-12-02 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 22/23] SUNRPC: simplify auth_unix.

2018-12-02 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-12-02 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-12-02 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 14/23] SUNRPC: add side channel to use non-generic cred for rpc call.

2018-12-02 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 17/23] NFS: change access cache to use 'struct cred'.

2018-12-02 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 13/23] SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none

2018-12-02 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 16/23] SUNRPC: remove RPCAUTH_AUTH_NO_CRKEY_TIMEOUT

2018-12-02 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 18/23] NFS: struct nfs_open_dir_context: convert rpc_cred pointer to cred.

2018-12-02 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 20/23] SUNRPC: remove generic cred code.

2018-12-02 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 15/23] NFS: move credential expiry tracking out of SUNRPC into NFS.

2018-12-02 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

[PATCH 10/23] NFSv4: don't require lock for get_renew_cred or get_machine_cred

2018-12-02 Thread NeilBrown
that the original need for the locking here was removed long ago, and there is no longer anything to protect. Signed-off-by: NeilBrown --- fs/nfs/nfs4_fs.h|6 +++--- fs/nfs/nfs4proc.c |4 ++-- fs/nfs/nfs4renewd.c |5 + fs/nfs/nfs4state.c | 26 ++ 4 files changed

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

2018-12-02 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 11/23] SUNRPC: discard RPC_DO_ROOTOVERRIDE()

2018-12-02 Thread NeilBrown
it is never used. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7b540c066594..f542dad8d4ab 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc

[PATCH 09/23] NFSv4: add cl_root_cred for use when machine cred is not available.

2018-12-02 Thread NeilBrown
cl_machine_cred and cl_root_cred will disappear later in the series. Signed-off-by: NeilBrown --- fs/nfs/client.c |2 ++ fs/nfs/nfs4state.c| 20 include/linux/nfs_fs_sb.h |1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/fs/nfs/client.c

[PATCH 08/23] SUNRPC: remove machine_cred field from struct auth_cred

2018-12-02 Thread NeilBrown
oot credential instead. This appears to be what is expected of the caller, and is clearly the result provided by both auth_unix and auth_gss which already ignore the flag. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|3 +-- net/sunrpc/auth_generic.c | 12 ++--

[PATCH 07/23] SUNRPC: remove uid and gid from struct auth_cred

2018-12-02 Thread NeilBrown
Use cred->fsuid and cred->fsgid instead. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 14 -- fs/nfsd/nfs4callback.c |6 ++ include/linux/sunrpc/auth.h|3 --- net/sunrpc/auth.c |6 +

[PATCH 04/23] cred: allow get_cred() and put_cred() to be given NULL.

2018-12-02 Thread NeilBrown
It is common practice for helpers like this to silently, accept a NULL pointer. get_rpccred() and put_rpccred() used by NFS act this way and using the same interface will ease the conversion for NFS, and simplify the resulting code. Signed-off-by: NeilBrown --- include/linux/cred.h | 14

[PATCH 06/23] SUNRPC: remove groupinfo from struct auth_cred.

2018-12-02 Thread NeilBrown
We can use cred->groupinfo (from the 'struct cred') instead. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 14 +- include/linux/sunrpc/auth.h|1 - net/sunrpc/auth.c |1 - net/sunrpc/auth_generic.c |

[PATCH 05/23] SUNRPC: add 'struct cred *' to auth_cred and rpc_cred

2018-12-02 Thread NeilBrown
the reference, and "acred" shares it. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 17 + fs/nfsd/nfs4callback.c | 13 - include/linux/sunrpc/auth.h|2 ++ net/sunrpc/auth.c

[PATCH 01/23] cred: add cred_fscmp() for comparing creds.

2018-12-02 Thread NeilBrown
to more consistent use of 'struct cred' we need a comparison function. This patch adds that function. Signed-off-by: NeilBrown --- include/linux/cred.h |1 + kernel/cred.c| 55 ++ 2 files changed, 56 insertions(+) diff --git a/include/linux

[PATCH 00/23 - V5] NFS: Remove generic RPC credentials.

2018-12-02 Thread NeilBrown
, NeilBrown --- NeilBrown (23): cred: add cred_fscmp() for comparing creds. cred: add get_cred_rcu() cred: export get_task_cred(). cred: allow get_cred() and put_cred() to be given NULL. SUNRPC: add 'struct cred *' to auth_cred and rpc_cred SUNRPC: remove groupinfo from

[PATCH 02/23] cred: add get_cred_rcu()

2018-12-02 Thread NeilBrown
it in get_task_cred(). Signed-off-by: NeilBrown --- include/linux/cred.h | 11 +++ kernel/cred.c|2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/cred.h b/include/linux/cred.h index f1085767e1b3..48979fcb95cf 100644 --- a/include/linux/cred.h +++ b

[PATCH 03/23] cred: export get_task_cred().

2018-12-02 Thread NeilBrown
There is no reason that modules should not be able to use this, and NFS will need it when converted to use 'struct cred'. Signed-off-by: NeilBrown --- kernel/cred.c |1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cred.c b/kernel/cred.c index ba60162249e8..21f4a97085b4 100644

Re: [PATCH - resend*2] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2018-11-29 Thread NeilBrown
On Thu, Nov 29 2018, Al Viro wrote: > On Fri, Nov 30, 2018 at 10:33:18AM +1100, NeilBrown wrote: >> >> The synchronize_rcu() in namespace_unlock() is called every time >> a filesystem is unmounted. If a great many filesystems are mounted, >> this can cause a noticabl

Re: [PATCH - resend*2] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2018-11-29 Thread NeilBrown
() to synchronize_rcu_expedited() the umount time on a 4-cpu VM drop to 0.6 seconds I think this 200-fold speed up is worth the slightly high system impact of using synchronize_rcu_expedited(). Acked-by: Paul E. McKenney (from general rcu perspective) Signed-off-by: NeilBrown --- Al Viro says "I can

Re: [PATCH 00/23 - V4] NFS: Remove generic RPC credentials.

2018-11-29 Thread NeilBrown
Hi, has anyone else had a chance to look at this yet? There is a small conflict now due to SUNRPC: Fix a bogus get/put in generic_key_to_expire() Should I resend with that fixed up? Thanks, NeilBrown On Wed, Nov 07 2018, NeilBrown wrote: > This is an updated version of a serie

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

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

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

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

[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 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 07/23] SUNRPC: remove uid and gid from struct auth_cred

2018-11-06 Thread NeilBrown
Use cred->fsuid and cred->fsgid instead. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 14 -- fs/nfsd/nfs4callback.c |6 ++ include/linux/sunrpc/auth.h|3 --- net/sunrpc/auth.c |6 +

[PATCH 11/23] SUNRPC: discard RPC_DO_ROOTOVERRIDE()

2018-11-06 Thread NeilBrown
it is never used. Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h |1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7b540c066594..f542dad8d4ab 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc

[PATCH 10/23] NFSv4: don't require lock for get_renew_cred or get_machine_cred

2018-11-06 Thread NeilBrown
that the original need for the locking here was removed long ago, and there is no longer anything to protect. Signed-off-by: NeilBrown --- fs/nfs/nfs4_fs.h|6 +++--- fs/nfs/nfs4proc.c |4 ++-- fs/nfs/nfs4renewd.c |5 + fs/nfs/nfs4state.c | 26 ++ 4 files changed

[PATCH 09/23] NFSv4: add cl_root_cred for use when machine cred is not available.

2018-11-06 Thread NeilBrown
cl_machine_cred and cl_root_cred will disappear later in the series. Signed-off-by: NeilBrown --- fs/nfs/client.c |2 ++ fs/nfs/nfs4state.c| 20 include/linux/nfs_fs_sb.h |1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/fs/nfs/client.c

[PATCH 06/23] SUNRPC: remove groupinfo from struct auth_cred.

2018-11-06 Thread NeilBrown
We can use cred->groupinfo (from the 'struct cred') instead. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 14 +- include/linux/sunrpc/auth.h|1 - net/sunrpc/auth.c |1 - net/sunrpc/auth_generic.c |

[PATCH 05/23] SUNRPC: add 'struct cred *' to auth_cred and rpc_cred

2018-11-06 Thread NeilBrown
the reference, and "acred" shares it. Signed-off-by: NeilBrown --- fs/nfs/flexfilelayout/flexfilelayout.c | 17 + fs/nfsd/nfs4callback.c | 13 - include/linux/sunrpc/auth.h|2 ++ net/sunrpc/auth.c

[PATCH 08/23] SUNRPC: remove machine_cred field from struct auth_cred

2018-11-06 Thread NeilBrown
oot credential instead. This appears to be what is expected of the caller, and is clearly the result provided by both auth_unix and auth_gss which already ignore the flag. Signed-off-by: NeilBrown --- include/linux/sunrpc/auth.h|3 +-- net/sunrpc/auth_generic.c | 12 ++--

[PATCH 02/23] cred: add get_cred_rcu()

2018-11-06 Thread NeilBrown
it in get_task_cred(). Signed-off-by: NeilBrown --- include/linux/cred.h | 11 +++ kernel/cred.c|2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/cred.h b/include/linux/cred.h index f1085767e1b3..48979fcb95cf 100644 --- a/include/linux/cred.h +++ b

[PATCH 00/23 - V4] NFS: Remove generic RPC credentials.

2018-11-06 Thread NeilBrown
comments most welcome. Thanks, NeilBrown --- NeilBrown (23): cred: add cred_fscmp() for comparing creds. cred: add get_cred_rcu() cred: export get_task_cred(). cred: allow get_cred() and put_cred() to be given NULL. SUNRPC: add 'struct cred *' to auth_cred

[PATCH 04/23] cred: allow get_cred() and put_cred() to be given NULL.

2018-11-06 Thread NeilBrown
It is common practice for helpers like this to silently, accept a NULL pointer. get_rpccred() and put_rpccred() used by NFS act this way and using the same interface will ease the conversion for NFS, and simplify the resulting code. Signed-off-by: NeilBrown --- include/linux/cred.h | 14

[PATCH 01/23] cred: add cred_fscmp() for comparing creds.

2018-11-06 Thread NeilBrown
to more consistent use of 'struct cred' we need a comparison function. This patch adds that function. Signed-off-by: NeilBrown --- include/linux/cred.h |1 + kernel/cred.c| 55 ++ 2 files changed, 56 insertions(+) diff --git a/include/linux

[PATCH 03/23] cred: export get_task_cred().

2018-11-06 Thread NeilBrown
There is no reason that modules should not be able to use this, and NFS will need it when converted to use 'struct cred'. Signed-off-by: NeilBrown --- kernel/cred.c |1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cred.c b/kernel/cred.c index ba60162249e8..21f4a97085b4 100644

Re: [PATCH - resend] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2018-11-05 Thread NeilBrown
On Fri, Oct 05 2018, NeilBrown wrote: > The synchronize_rcu() in namespace_unlock() is called every time > a filesystem is unmounted. If a great many filesystems are mounted, > this can cause a noticable slow-down in, for example, system shutdown. > > The sequence: > mkdi

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

2018-11-05 Thread NeilBrown
On Mon, Nov 05 2018, Jeff Layton wrote: > On Mon, 2018-11-05 at 12:30 +1100, NeilBrown wrote: >> 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 t

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

2018-11-04 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 11/12] locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-04 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 08/12] fs/locks: always delete_block after waiting.

2018-11-04 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 06/12] locks: use properly initialized file_lock when unlocking.

2018-11-04 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 | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index b8f33792a0a6

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

2018-11-04 Thread NeilBrown
Wilck Signed-off-by: NeilBrown --- fs/locks.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 802d5853acd5..1b0eac6b2918 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -715,11 +715,25 @@ static void locks_delete_block

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

2018-11-04 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,

  1   2   3   4   5   6   7   8   9   10   >