summaryrefslogtreecommitdiff
path: root/include/scsi/fc_frame.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-04-24 08:29:13 +1000
committerDavid S. Miller <davem@davemloft.net>2018-04-24 13:21:46 -0400
commit5d240a8936f6a1d3ece06701e8c4d830a2eca8a8 (patch)
tree9ead6dcc79beb5b66ace316bf7b2106a1dafe881 /include/scsi/fc_frame.h
parentb41cc04b662ac96bbb291fb66b7b8aab5bc0a8c9 (diff)
rhashtable: improve rhashtable_walk stability when stop/start used.
When a walk of an rhashtable is interrupted with rhastable_walk_stop() and then rhashtable_walk_start(), the location to restart from is based on a 'skip' count in the current hash chain, and this can be incorrect if insertions or deletions have happened. This does not happen when the walk is not stopped and started as iter->p is a placeholder which is safe to use while holding the RCU read lock. In rhashtable_walk_start() we can revalidate that 'p' is still in the same hash chain. If it isn't then the current method is still used. With this patch, if a rhashtable walker ensures that the current object remains in the table over a stop/start period (possibly by elevating the reference count if that is sufficient), it can be sure that a walk will not miss objects that were in the hashtable for the whole time of the walk. rhashtable_walk_start() may not find the object even though it is still in the hashtable if a rehash has moved it to a new table. In this case it will (eventually) get -EAGAIN and will need to proceed through the whole table again to be sure to see everything at least once. Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/scsi/fc_frame.h')
0 files changed, 0 insertions, 0 deletions