Re: [PATCH v2 1/5] staging: lustre: llite: add support set_acl method in inode operations

2018-05-14 Thread NeilBrown
#ifdef CONFIG_FS_POSIX_ACL declare the functions #else #define ll_get_acl NULL #define ll_set_acl NULL #endif Now as this is staging and that is (presumably) an upstream patch lightly improved it is probably fine to include the patch as-is, but in that case we will probably want to fix it up

Re: [PATCH v2 1/5] staging: lustre: llite: add support set_acl method in inode operations

2018-05-14 Thread NeilBrown
#ifdef CONFIG_FS_POSIX_ACL declare the functions #else #define ll_get_acl NULL #define ll_set_acl NULL #endif Now as this is staging and that is (presumably) an upstream patch lightly improved it is probably fine to include the patch as-is, but in that case we will probably want to fix it u

Re: [PATCH v2] staging: lustre: obdclass: change object lookup to no wait mode

2018-05-14 Thread NeilBrown
ewed-by: Fan Yong <fan.y...@intel.com> > Reviewed-by: Oleg Drokin <oleg.dro...@intel.com> > Signed-off-by: James Simmons <jsimm...@infradead.org> Reviewed-by: NeilBrown <ne...@suse.com> Thanks :-) NeilBrown > --- > Changelog: > > v1) Initial patch that didn't

Re: [PATCH v2] staging: lustre: obdclass: change object lookup to no wait mode

2018-05-14 Thread NeilBrown
-id: https://jira.hpdd.intel.com/browse/LU-9049 > Reviewed-on: https://review.whamcloud.com/26965 > Reviewed-by: Alex Zhuravlev > Tested-by: Cliff White > Reviewed-by: Fan Yong > Reviewed-by: Oleg Drokin > Signed-off-by: James Simmons Reviewed-by: NeilBrown Thanks

Re: [PATCH 4/4] staging: lustre: obdclass: change object lookup to no wait mode

2018-05-14 Thread NeilBrown
ctly. >> > * >> > + * If dying object is found during index search, add @waiter to the >> > + * site wait-queue and return ERR_PTR(-EAGAIN). >> >> It seems odd to add this comment here, when it seems to describe code >> that is being removed. >

Re: [PATCH 4/4] staging: lustre: obdclass: change object lookup to no wait mode

2018-05-14 Thread NeilBrown
t; + * If dying object is found during index search, add @waiter to the >> > + * site wait-queue and return ERR_PTR(-EAGAIN). >> >> It seems odd to add this comment here, when it seems to describe code >> that is being removed. >> I can see that this comment i

Re: [PATCH] staging: lustre: Use 'kvfree()' for memory allocated by 'kvzalloc()'

2018-05-12 Thread NeilBrown
On Sat, May 12 2018, Christophe JAILLET wrote: > 'buf' is allocated with 'kvzalloc()'. 'kvfree()' must be used to free it. > > Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> Reviewed-by: NeilBrown <ne...@suse.com> Thanks. We could possible add: Fixes: 1

Re: [PATCH] staging: lustre: Use 'kvfree()' for memory allocated by 'kvzalloc()'

2018-05-12 Thread NeilBrown
On Sat, May 12 2018, Christophe JAILLET wrote: > 'buf' is allocated with 'kvzalloc()'. 'kvfree()' must be used to free it. > > Signed-off-by: Christophe JAILLET Reviewed-by: NeilBrown Thanks. We could possible add: Fixes: 11c647caf74b ("staging: lustre: obdclass: variable l

Re: [lustre-devel] [PATCH] staging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()

2018-05-10 Thread NeilBrown
.kib_global_lock, flags); > - list_for_each_entry_safe(rx, tmp, >ibc_early_rxs, rx_list) { > + while (!list_empty(>ibc_early_rxs)) { > + rx = list_entry(conn->ibc_early_rxs.next, > + kib_rx_t, rx_list); Should be:

Re: [lustre-devel] [PATCH] staging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()

2018-05-10 Thread NeilBrown
lags); > - list_for_each_entry_safe(rx, tmp, >ibc_early_rxs, rx_list) { > + while (!list_empty(>ibc_early_rxs)) { > + rx = list_entry(conn->ibc_early_rxs.next, > + kib_rx_t, rx_list); Should be: struct kib

Re: [PATCH] staging: lustre: lnet: add static to libcfs_dev declaration

2018-05-10 Thread NeilBrown
s - that was my fault. (b4ded66db93b) Reviewed-by: NeilBrown <ne...@suse.com> Thanks, NeilBrown > > Signed-off-by: Justin Skists <justin.ski...@juzza.co.uk> > --- > drivers/staging/lustre/lnet/libcfs/module.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH] staging: lustre: lnet: add static to libcfs_dev declaration

2018-05-10 Thread NeilBrown
s - that was my fault. (b4ded66db93b) Reviewed-by: NeilBrown Thanks, NeilBrown > > Signed-off-by: Justin Skists > --- > drivers/staging/lustre/lnet/libcfs/module.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lnet/libcfs/modul

[PATCH 5/6] staging: lustre: remove lock from key register/degister

2018-05-10 Thread NeilBrown
tested that code, but I don't think it can really happen. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 37 +--- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ob

[PATCH 5/6] staging: lustre: remove lock from key register/degister

2018-05-10 Thread NeilBrown
tested that code, but I don't think it can really happen. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 37 +--- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers

[PATCH 6/6] staging: lustre: rename lu_keys_guard to lu_context_remembered_guard

2018-05-10 Thread NeilBrown
the lc_remembers list, there can no longer be a race. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 22 +--- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/d

[PATCH 6/6] staging: lustre: rename lu_keys_guard to lu_context_remembered_guard

2018-05-10 Thread NeilBrown
the lc_remembers list, there can no longer be a race. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 22 +--- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre

[PATCH 2/6] staging: lustre: use an rwsem instead of lu_key_initing_cnt.

2018-05-10 Thread NeilBrown
, lu_context_refill() will need to be run anyway. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 53 +++- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/d

[PATCH 4/6] staging: lustre: use wait_event_var() in lu_context_key_degister()

2018-05-10 Thread NeilBrown
calls are not always protected by a lock, and there seems to be no need here. Nothing else can be acting on the given key in that context at this point, so no race is possible. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 18 +++--

[PATCH 1/6] staging: lustre: make key_set_version an atomic_t

2018-05-10 Thread NeilBrown
ple keys_set_version early. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 26 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre

[PATCH 3/6] staging: lustre: remove locking from lu_context_exit()

2018-05-10 Thread NeilBrown
. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lu_object.h |1 drivers/staging/lustre/lustre/obdclass/lu_object.c | 41 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/include

[PATCH 2/6] staging: lustre: use an rwsem instead of lu_key_initing_cnt.

2018-05-10 Thread NeilBrown
, lu_context_refill() will need to be run anyway. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 53 +++- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre

[PATCH 4/6] staging: lustre: use wait_event_var() in lu_context_key_degister()

2018-05-10 Thread NeilBrown
calls are not always protected by a lock, and there seems to be no need here. Nothing else can be acting on the given key in that context at this point, so no race is possible. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 18 +++--- 1 file chan

[PATCH 1/6] staging: lustre: make key_set_version an atomic_t

2018-05-10 Thread NeilBrown
ple keys_set_version early. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 26 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c in

[PATCH 3/6] staging: lustre: remove locking from lu_context_exit()

2018-05-10 Thread NeilBrown
. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lu_object.h |1 drivers/staging/lustre/lustre/obdclass/lu_object.c | 41 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/driver

RFC: [PATCH 0/6] lustre: Improve locking in lu_object.s

2018-05-10 Thread NeilBrown
. Thanks, NeilBrown --- NeilBrown (6): staging: lustre: make key_set_version an atomic_t staging: lustre: use an rwsem instead of lu_key_initing_cnt. staging: lustre: remove locking from lu_context_exit() staging: lustre: use wait_event_var() in lu_context_key_degister

RFC: [PATCH 0/6] lustre: Improve locking in lu_object.s

2018-05-10 Thread NeilBrown
. Thanks, NeilBrown --- NeilBrown (6): staging: lustre: make key_set_version an atomic_t staging: lustre: use an rwsem instead of lu_key_initing_cnt. staging: lustre: remove locking from lu_context_exit() staging: lustre: use wait_event_var() in lu_context_key_degister

Re: [PATCH/RFC] mtd: spi-nor: honour max_message_size for spi-nor writes.

2018-05-10 Thread NeilBrown
On Thu, May 10 2018, Marek Vasut wrote: > On 05/10/2018 12:28 AM, NeilBrown wrote: >> On Wed, May 09 2018, Boris Brezillon wrote: >> >>> On Fri, 27 Apr 2018 16:18:05 +1000 >>> NeilBrown <n...@brown.name> wrote: >>> >>>> Hi, >

Re: [PATCH/RFC] mtd: spi-nor: honour max_message_size for spi-nor writes.

2018-05-10 Thread NeilBrown
On Thu, May 10 2018, Marek Vasut wrote: > On 05/10/2018 12:28 AM, NeilBrown wrote: >> On Wed, May 09 2018, Boris Brezillon wrote: >> >>> On Fri, 27 Apr 2018 16:18:05 +1000 >>> NeilBrown wrote: >>> >>>> Hi, >>>> I've labeled this

Re: [PATCH/RFC] mtd: spi-nor: honour max_message_size for spi-nor writes.

2018-05-09 Thread NeilBrown
On Wed, May 09 2018, Boris Brezillon wrote: > On Fri, 27 Apr 2018 16:18:05 +1000 > NeilBrown <n...@brown.name> wrote: > >> Hi, >> I've labeled this an RFC because I'm really not sure about removing the >> error path from spi_nor_write() -- maybe that really

Re: [PATCH/RFC] mtd: spi-nor: honour max_message_size for spi-nor writes.

2018-05-09 Thread NeilBrown
On Wed, May 09 2018, Boris Brezillon wrote: > On Fri, 27 Apr 2018 16:18:05 +1000 > NeilBrown wrote: > >> Hi, >> I've labeled this an RFC because I'm really not sure about removing the >> error path from spi_nor_write() -- maybe that really matters. But on >>

Re: [PATCH v2] MIPS: c-r4k: fix data corruption related to cache coherence.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, James Hogan wrote: > On Mon, May 07, 2018 at 07:40:49AM +1000, NeilBrown wrote: >> >> Hi James, >> this hasn't appear in linux-next yet, or in any branch >> of >>git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git >> &g

Re: [PATCH v2] MIPS: c-r4k: fix data corruption related to cache coherence.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, James Hogan wrote: > On Mon, May 07, 2018 at 07:40:49AM +1000, NeilBrown wrote: >> >> Hi James, >> this hasn't appear in linux-next yet, or in any branch >> of >>git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git >> &g

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:37:49AM +1000, NeilBrown wrote: >> >> I can see no evidence that this is required for anything, as it isn't >> use and I'm fairly sure that in it's current form - it cannot be used. > > S

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:37:49AM +1000, NeilBrown wrote: >> >> I can see no evidence that this is required for anything, as it isn't >> use and I'm fairly sure that in it's current form - it cannot be used. > > S

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:50:54AM +1000, NeilBrown wrote: >> >> Do we? How could we fix it for both rhashtable and rhltable? > > Well I suggested earlier to insert the walker object into the > hash table, which would be applicab

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:50:54AM +1000, NeilBrown wrote: >> >> Do we? How could we fix it for both rhashtable and rhltable? > > Well I suggested earlier to insert the walker object into the > hash table, which would be applicab

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Mon, May 07, 2018 at 08:24:41AM +1000, NeilBrown wrote: >> >> This is true, but I don't see how it is relevant. >> At some point, each thread will find that the table they have just >> locked for their search key, has

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-07 Thread NeilBrown
On Mon, May 07 2018, Herbert Xu wrote: > On Mon, May 07, 2018 at 08:24:41AM +1000, NeilBrown wrote: >> >> This is true, but I don't see how it is relevant. >> At some point, each thread will find that the table they have just >> locked for their search key, has

[PATCH 00/10 - v2] staging: lustre: assorted improvements.

2018-05-06 Thread NeilBrown
mentioned a while back. Thanks, NeilBrown --- NeilBrown (10): staging: lustre: ldlm: store name directly in namespace. staging: lustre: make struct lu_site_bkt_data private staging: lustre: lu_object: discard extra lru count. staging: lustre: lu_object: move retry logic

[PATCH 00/10 - v2] staging: lustre: assorted improvements.

2018-05-06 Thread NeilBrown
mentioned a while back. Thanks, NeilBrown --- NeilBrown (10): staging: lustre: ldlm: store name directly in namespace. staging: lustre: make struct lu_site_bkt_data private staging: lustre: lu_object: discard extra lru count. staging: lustre: lu_object: move retry logic

[PATCH 10/10] staging: lustre: fix error deref in ll_splice_alias().

2018-05-06 Thread NeilBrown
org> Fixes: e9d4f0b9f559 ("staging: lustre: llite: use d_splice_alias for directories.") Reviewed-by: James Simmons <jsimm...@infradead.org> Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/namei.c |9 +++-- 1 file changed, 7 inserti

[PATCH 10/10] staging: lustre: fix error deref in ll_splice_alias().

2018-05-06 Thread NeilBrown
("staging: lustre: llite: use d_splice_alias for directories.") Reviewed-by: James Simmons Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c

[PATCH 03/10] staging: lustre: lu_object: discard extra lru count.

2018-05-06 Thread NeilBrown
is not essential, and the per-cpu counter can be used to get the combined total. So discard the per-bucket lsb_lru_len. Reviewed-by: Andreas Dilger <andreas.dil...@dilger.ca> Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 27 +---

[PATCH 03/10] staging: lustre: lu_object: discard extra lru count.

2018-05-06 Thread NeilBrown
is not essential, and the per-cpu counter can be used to get the combined total. So discard the per-bucket lsb_lru_len. Reviewed-by: Andreas Dilger Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 27 +--- 1 file changed, 12 insertions(+), 15 deletions

[PATCH 09/10] staging: lustre: move remaining code from linux-module.c to module.c

2018-05-06 Thread NeilBrown
There is no longer any need to keep this code separate, and now we can remove linux-module.c Reviewed-by: James Simmons <jsimm...@infradead.org> Signed-off-by: NeilBrown <ne...@suse.com> --- .../staging/lustre/include/linux/libcfs/libcfs.h |4 drivers/staging/lustre/lnet/lib

[PATCH 08/10] staging: lustre: move misc-device registration closer to related code.

2018-05-06 Thread NeilBrown
The ioctl handler for the misc device is in lnet/libcfs/module.c but is it registered in lnet/libcfs/linux/linux-module.c. Keeping related code together make maintenance easier, so move the code. Reviewed-by: James Simmons <jsimm...@infradead.org> Signed-off-by: NeilBrown <ne...

[PATCH 09/10] staging: lustre: move remaining code from linux-module.c to module.c

2018-05-06 Thread NeilBrown
There is no longer any need to keep this code separate, and now we can remove linux-module.c Reviewed-by: James Simmons Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs/libcfs.h |4 drivers/staging/lustre/lnet/libcfs/Makefile|1 .../lustre/lnet/libcfs

[PATCH 08/10] staging: lustre: move misc-device registration closer to related code.

2018-05-06 Thread NeilBrown
The ioctl handler for the misc device is in lnet/libcfs/module.c but is it registered in lnet/libcfs/linux/linux-module.c. Keeping related code together make maintenance easier, so move the code. Reviewed-by: James Simmons Signed-off-by: NeilBrown --- .../staging/lustre/include/linux/libcfs

[PATCH 05/10] staging: lustre: fold lu_object_new() into lu_object_find_at()

2018-05-06 Thread NeilBrown
lu_object_new() duplicates a lot of code that is in lu_object_find_at(). There is no real need for a separate function, it is simpler just to skip the bits of lu_object_find_at() that we don't want in the LOC_F_NEW case. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/

[PATCH 06/10] staging: lustre: llite: use more private data in dump_pgcache

2018-05-06 Thread NeilBrown
'seq_private' structure which stores the sbi, env, and refcheck, and attach this to the seqfile. Then use it throughout instead of allocating 'env' repeatedly. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 148 - 1 file chang

[PATCH 04/10] staging: lustre: lu_object: move retry logic inside htable_lookup

2018-05-06 Thread NeilBrown
this a 'goto' loop rather than a 'while(1)' loop as the diff is easier to read. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 70 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/drivers/staging/lustre/

[PATCH 06/10] staging: lustre: llite: use more private data in dump_pgcache

2018-05-06 Thread NeilBrown
'seq_private' structure which stores the sbi, env, and refcheck, and attach this to the seqfile. Then use it throughout instead of allocating 'env' repeatedly. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 148 - 1 file changed, 72 insertions

[PATCH 04/10] staging: lustre: lu_object: move retry logic inside htable_lookup

2018-05-06 Thread NeilBrown
this a 'goto' loop rather than a 'while(1)' loop as the diff is easier to read. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/lu_object.c | 70 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass

[PATCH 05/10] staging: lustre: fold lu_object_new() into lu_object_find_at()

2018-05-06 Thread NeilBrown
lu_object_new() duplicates a lot of code that is in lu_object_find_at(). There is no real need for a separate function, it is simpler just to skip the bits of lu_object_find_at() that we don't want in the LOC_F_NEW case. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass

[PATCH 02/10] staging: lustre: make struct lu_site_bkt_data private

2018-05-06 Thread NeilBrown
com> Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/include/lu_object.h | 36 +- drivers/staging/lustre/lustre/llite/lcommon_cl.c |8 ++- drivers/staging/lustre/lustre/lov/lov_object.c |8 ++- drivers/staging/lustre/lustre/obdclass/lu_obj

[PATCH 07/10] staging: lustre: llite: remove redundant lookup in dump_pgcache

2018-05-06 Thread NeilBrown
, and finds the clob where it was stored. Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 98 ++--- 1 file changed, 41 insertions(+), 57 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/s

[PATCH 07/10] staging: lustre: llite: remove redundant lookup in dump_pgcache

2018-05-06 Thread NeilBrown
, and finds the clob where it was stored. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/vvp_dev.c | 98 ++--- 1 file changed, 41 insertions(+), 57 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/l

[PATCH 02/10] staging: lustre: make struct lu_site_bkt_data private

2018-05-06 Thread NeilBrown
This data structure only needs to be public so that various modules can access a wait queue to wait for object destruction. If we provide a function to get the wait queue, rather than the whole bucket, the structure can be made private. Reviewed-by: Andreas Dilger Signed-off-by: NeilBrown

[PATCH 01/10] staging: lustre: ldlm: store name directly in namespace.

2018-05-06 Thread NeilBrown
Rather than storing the name of a namespace in the hash table, store it directly in the namespace. This will allow the hashtable to be changed to use rhashtable. Reviewed-by: James Simmons <jsimm...@infradead.org> Signed-off-by: NeilBrown <ne...@suse.com> --- drivers/staging/l

[PATCH 01/10] staging: lustre: ldlm: store name directly in namespace.

2018-05-06 Thread NeilBrown
Rather than storing the name of a namespace in the hash table, store it directly in the namespace. This will allow the hashtable to be changed to use rhashtable. Reviewed-by: James Simmons Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/include/lustre_dlm.h |5 - drivers

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-06 Thread NeilBrown
On Sun, May 06 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 08:00:49AM +1000, NeilBrown wrote: >> >> The insert function must (and does) take the lock on the bucket before >> testing if there is a "next" table. >> If one inserter finds that it

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-06 Thread NeilBrown
On Sun, May 06 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 08:00:49AM +1000, NeilBrown wrote: >> >> The insert function must (and does) take the lock on the bucket before >> testing if there is a "next" table. >> If one inserter finds that it

Re: [PATCH 7/8] rhashtable: add rhashtable_walk_prev()

2018-05-06 Thread NeilBrown
On Sat, May 05 2018, Tom Herbert wrote: > On Sat, May 5, 2018 at 2:43 AM, Herbert Xu <herb...@gondor.apana.org.au> > wrote: >> On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >>> rhashtable_walk_prev() returns the object returned by >>> the previo

Re: [PATCH 7/8] rhashtable: add rhashtable_walk_prev()

2018-05-06 Thread NeilBrown
On Sat, May 05 2018, Tom Herbert wrote: > On Sat, May 5, 2018 at 2:43 AM, Herbert Xu > wrote: >> On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >>> rhashtable_walk_prev() returns the object returned by >>> the previous rhashtable_walk_next(), providin

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-06 Thread NeilBrown
On Sun, May 06 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:48:20AM +1000, NeilBrown wrote: >> >> The spinlock protects 2 or more buckets. The nested table contains at >> least 512 buckets, maybe more. >> It is quite possible for two insertions into 2 diffe

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-06 Thread NeilBrown
On Sun, May 06 2018, Herbert Xu wrote: > On Sun, May 06, 2018 at 07:48:20AM +1000, NeilBrown wrote: >> >> The spinlock protects 2 or more buckets. The nested table contains at >> least 512 buckets, maybe more. >> It is quite possible for two insertions into 2 diffe

Re: [PATCH v2] MIPS: c-r4k: fix data corruption related to cache coherence.

2018-05-06 Thread NeilBrown
Hi James, this hasn't appear in linux-next yet, or in any branch of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git Should I expect it to? Thanks, NeilBrown On Fri, Apr 27 2018, NeilBrown wrote: > When DMA will be performed to a MIPS32 1004K CPS, the > L1

Re: [PATCH v2] MIPS: c-r4k: fix data corruption related to cache coherence.

2018-05-06 Thread NeilBrown
Hi James, this hasn't appear in linux-next yet, or in any branch of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git Should I expect it to? Thanks, NeilBrown On Fri, Apr 27 2018, NeilBrown wrote: > When DMA will be performed to a MIPS32 1004K CPS, the > L1

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> rhashtable_try_insert() currently hold a lock on the bucket in >> the first table, while also locking buckets in subsequent tables. >> This is unnecessary and looks like

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> rhashtable_try_insert() currently hold a lock on the bucket in >> the first table, while also locking buckets in subsequent tables. >> This is unnecessary and looks like

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> If the sequence: >>obj = rhashtable_walk_next(iter); >>rhashtable_walk_stop(iter); >>rhashtable_remove_fast(ht, >head, params); >>rhasht

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> If the sequence: >>obj = rhashtable_walk_next(iter); >>rhashtable_walk_stop(iter); >>rhashtable_remove_fast(ht, >head, params); >>rhasht

Re: [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> print_ht in rhashtable_test calls rht_dereference() with neither >> RCU protection or the mutex. This triggers an RCU warning. >> So take the mutex to silence the warni

Re: [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> print_ht in rhashtable_test calls rht_dereference() with neither >> RCU protection or the mutex. This triggers an RCU warning. >> So take the mutex to silence the warni

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> If two threads run nested_table_alloc() at the same time >> they could both allocate a new table. >> Best case is that one of them will never be freed, leaking memory. >&

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> If two threads run nested_table_alloc() at the same time >> they could both allocate a new table. >> Best case is that one of them will never be freed, leaking memory. >&

Re: [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> Rather than borrowing one of the bucket locks to >> protect ->future_tbl updates, use cmpxchg(). >> This gives more freedom to change how bucket locking >> is

Re: [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> Rather than borrowing one of the bucket locks to >> protect ->future_tbl updates, use cmpxchg(). >> This gives more freedom to change how bucket locking >> is

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> This "feature" is unused, undocumented, and untested and so >> doesn't really belong. If a use for the nulls marker >> is found, all this code would need to be

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-05 Thread NeilBrown
On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> This "feature" is unused, undocumented, and untested and so >> doesn't really belong. If a use for the nulls marker >> is found, all this code would need to be

[PATCH 7/8] staging: mt7621-pci: remove some dead code.

2018-05-03 Thread NeilBrown
Some code is dead because it is commented out. Some is dead because it is uninteresting printks. Some is dead because it declares unused functions. Remove it all. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-pci/pci-mt7621.c | 14 -- 1 file chang

[PATCH 6/8] staging: mt7621-pci: remove unnecessary resource details.

2018-05-03 Thread NeilBrown
These resources are extracted from devicetree, so they aren't needed here. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-pci/pci-mt7621.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt762

[PATCH 6/8] staging: mt7621-pci: remove unnecessary resource details.

2018-05-03 Thread NeilBrown
These resources are extracted from devicetree, so they aren't needed here. Signed-off-by: NeilBrown --- drivers/staging/mt7621-pci/pci-mt7621.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging

[PATCH 7/8] staging: mt7621-pci: remove some dead code.

2018-05-03 Thread NeilBrown
Some code is dead because it is commented out. Some is dead because it is uninteresting printks. Some is dead because it declares unused functions. Remove it all. Signed-off-by: NeilBrown --- drivers/staging/mt7621-pci/pci-mt7621.c | 14 -- 1 file changed, 14 deletions(-) diff

[PATCH 2/8] staging: mt7621-spi: remove unused lock.

2018-05-03 Thread NeilBrown
This lock is never initialized, locked once, and never unlocked. Clearly it is pointless - so remove it. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-spi/spi-mt7621.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-spi/spi-mt762

[PATCH 2/8] staging: mt7621-spi: remove unused lock.

2018-05-03 Thread NeilBrown
This lock is never initialized, locked once, and never unlocked. Clearly it is pointless - so remove it. Signed-off-by: NeilBrown --- drivers/staging/mt7621-spi/spi-mt7621.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-spi/spi-mt7621.c b/drivers/staging

[PATCH 1/8] staging: mt7621-eth: Lock is never unlocked.

2018-05-03 Thread NeilBrown
mtk_phy_link_adjust takes a spinlock and disables interrupts, but never unlocks. This can leave interrupts disabled on one CPU and various things stop working. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-eth/mdio.c |1 + 1 file changed, 1 insertion(+) diff

[PATCH 3/8] staging: mt7621-pci: improve interrupt mapping

2018-05-03 Thread NeilBrown
that the hwirq number are mapped to virq numbers for us, so the ugly hack can go. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-dts/mt7621.dtsi |9 ++- drivers/staging/mt7621-pci/pci-mt7621.c | 90 +++ 2 files changed, 14 insertions(

[PATCH 1/8] staging: mt7621-eth: Lock is never unlocked.

2018-05-03 Thread NeilBrown
mtk_phy_link_adjust takes a spinlock and disables interrupts, but never unlocks. This can leave interrupts disabled on one CPU and various things stop working. Signed-off-by: NeilBrown --- drivers/staging/mt7621-eth/mdio.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging

[PATCH 3/8] staging: mt7621-pci: improve interrupt mapping

2018-05-03 Thread NeilBrown
that the hwirq number are mapped to virq numbers for us, so the ugly hack can go. Signed-off-by: NeilBrown --- drivers/staging/mt7621-dts/mt7621.dtsi |9 ++- drivers/staging/mt7621-pci/pci-mt7621.c | 90 +++ 2 files changed, 14 insertions(+), 85 deletions

[PATCH 8/8] staging: mt7621-dts: update nor-flash info for gnubee1

2018-05-03 Thread NeilBrown
The GNUBEE has 32MB flash, so set partitions accordingly. Also remove "m25p,chunked-io" which isn't documented or used anywhere (outside of freewrt). Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-dts/gbpc1.dts |3 +-- 1 file changed, 1 insertion

[PATCH 4/8] staging: mt7621-pci: white-space cleanups.

2018-05-03 Thread NeilBrown
- remove white space at end of line. - no more than 2 blank line at a time - remove spaces before tabs - use tabs to line things up - re-indent some #define do{}while(0) Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH 8/8] staging: mt7621-dts: update nor-flash info for gnubee1

2018-05-03 Thread NeilBrown
The GNUBEE has 32MB flash, so set partitions accordingly. Also remove "m25p,chunked-io" which isn't documented or used anywhere (outside of freewrt). Signed-off-by: NeilBrown --- drivers/staging/mt7621-dts/gbpc1.dts |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH 4/8] staging: mt7621-pci: white-space cleanups.

2018-05-03 Thread NeilBrown
- remove white space at end of line. - no more than 2 blank line at a time - remove spaces before tabs - use tabs to line things up - re-indent some #define do{}while(0) Signed-off-by: NeilBrown --- drivers/staging/mt7621-pci/pci-mt7621.c | 291 +++ 1 file changed

[PATCH 5/8] staging: mt7621-pci: remove conditional compilation.

2018-05-03 Thread NeilBrown
the code for different ports is easy to identify. Signed-off-by: NeilBrown <n...@brown.name> --- drivers/staging/mt7621-pci/pci-mt7621.c | 70 +++ 1 file changed, 15 insertions(+), 55 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/s

[PATCH 5/8] staging: mt7621-pci: remove conditional compilation.

2018-05-03 Thread NeilBrown
the code for different ports is easy to identify. Signed-off-by: NeilBrown --- drivers/staging/mt7621-pci/pci-mt7621.c | 70 +++ 1 file changed, 15 insertions(+), 55 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci

[PATCH 0/8] staging: various mt7621 fixes

2018-05-03 Thread NeilBrown
Highlights here are a bugfix for the ethernet driver, and proper handling of irq assignments in the PCI driver. We also make the full 32M of the gnubee flash available and start cleaning up the mt7621-pci code. --- NeilBrown (8): staging: mt7621-eth: Lock is never unlocked. staging

[PATCH 0/8] staging: various mt7621 fixes

2018-05-03 Thread NeilBrown
Highlights here are a bugfix for the ethernet driver, and proper handling of irq assignments in the PCI driver. We also make the full 32M of the gnubee flash available and start cleaning up the mt7621-pci code. --- NeilBrown (8): staging: mt7621-eth: Lock is never unlocked. staging

[PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-03 Thread NeilBrown
ble_walk_next() is called while p is not NULL and not safe, it walks the chain looking for the first object with an address greater than p and returns that. If there is none, it moves to the next hash chain. Signed-off-by: NeilBrown <ne...@suse.com> --- include/linux/rhashtable.h

[PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-03 Thread NeilBrown
ble_walk_next() is called while p is not NULL and not safe, it walks the chain looking for the first object with an address greater than p and returns that. If there is none, it moves to the next hash chain. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 11 +- lib

<    3   4   5   6   7   8   9   10   11   12   >